Share this page

Monday, November 16, 2009

How to extend the context menu of a list in SharePoint 2007

In this article we are going to review how we can extend the context menu of a list of SharePoint 2007 as we can see in Image 1. To create this project I’m using the last version of WSPBuilder from Codeplex.

[Image 1]

The first task that we need to do is create a new project using the template installed by WSPBuilder installer. Once the project was created we must add a new item to the project using other template. This option must be a blank feature then we are going to find a BlankFeature template in the templates available to create our feature. The project in Visual Studio 2008 should be as we can see in Image 2.

[Image 2]

The last step is adding a CustomAction node in the XML file element.xml. This node is using to add the option in the contextual menu of the list by SharePoint and the action as we can see in Section 1.

[Section 1]

<Elements xmlns="">
    Title="Check Item"
    Description="Check Item in the List"
    RegistrationId ="0x01"
    <UrlAction Url="~site/default.aspx?ListId={ListId}"/>

Once the package was installed and the feature activated we can see the new option in the elements of the each list in SharePoint 2007. When we selected it the action that was declared in the UrlAction node will be fired to SharePoint.

Download Source Code

Fabián Imaz

No comments: