Tuesday, October 16, 2012

How To Create an ECB menu to Wiki library in Sharepoint 2010


In order to add a custom menu to any list/library in sharepoint, we need to create a custom action; We need to specify the registrationID (templateID) correctly to identify the list template. List of template IDs can be found here

Steps

1.     Create a new Empty Sharepoint project
2.     Deploy as a farm solution
3.     Add New Feature


4.     By default it will be added as Feature1; Rename the feature


        5.  Select scope to "Web"


6.     Add new item and select Empty element




7.     Add the below xml to the element.xml;
     The registration Id 119 corresponds to the wiki library.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="CA_Wiki"
    RegistrationType="List"
    RegistrationId="119"
    ImageUrl="/_layouts/1033/Images/RTEDCELL.GIF"
    Location="EditControlBlock"
    Sequence="301"
    Title="My Custom ECB Menu Item for Wiki" >
    <UrlAction
      Url="http://msn.com"/>
   
  </CustomAction>
</Elements>

8.     Deploy the solution and check in your wiki library



No comments:

Post a Comment