Creating Custom Actions Menu for Specific Lists in SharePoint


Method 1.

Create a custom content type by inheriting from any one of the standard Windows SharePoint Services content types.

Make sure that ID of your custom content type should be RegistrationId of the customaction in the element file tag.Also make sure that the RegistrationType in CustomAction tab is set to ContentType.

Create and deploy feature.

Create a list which will be using the custom content type that you have created above.

For more info: http://msdn.microsoft.com/en-us/library/ms473643.aspx

Method 2.

Create a feature as shown below:

1<feature id="23047644-6891-4ee7-90E8-1177AF155233" title="Custom List Action Menu." description="Custom List Action Menu." scope="Site" xmlns="http://schemas.microsoft.com/sharepoint/">
2<elementmanifests>
3<elementmanifest location="Elements.xml">
4<elementfile location="CustomListAction\schema.xml">
5</elementfile></elementmanifest></elementmanifests>
6</feature>

Create a Elements.xml as shown below:

 
1<!--?xml version="1.0" encoding="utf-8"? -->
2  Elements xmlns="http://schemas.microsoft.com/sharepoint/" Id="0A9C0CE0-7EAE-47c3-8209-54A872250E08?>
3  <listtemplate name="CustomListAction" type="1111" cacheschema="TRUE" basetype="0" onquicklaunch="TRUE" sequence="320" displayname="CustomListAction." image="/_layouts/images/word.jpg">
4  <customaction id="SY.Custom.Menu" title="Export to word." description="Click here to export list data to word document." registrationtype="List" registrationid="1111" groupid="ActionsMenu" location="Microsoft.SharePoint.StandardMenu" imageurl="/_layouts/images/msword_export.jpg" sequence="300">
5  <urlaction url="/_layouts/ExportWord.aspx">
6  </urlaction></customaction>
7  </listtemplate>


Now create a folder named as "CustomListAction" and add
Allitems.aspx,DispForm.aspx,EditForm,NewForm and Schema.xml.

    Note: The ListTemplate Name and folder name should be same.

Copy Feature.xml,Elements.xml and CustomListAction folder in CustomListActionFeature folder
and install in Feature directory in 12 hive Using stsadm command.

    stsadm -o installfeature -filename CustomListActionFeature\Feature.xml

    stsadm -o activatefeature -name CustomListActionFeature -url http://mossportal/


    and finally do iisreset

Now create List from newly installed ListTemplate thats it !!!!!.

Comments