Monday, September 29, 2008

Adding link in List Item context menu

Many times during the customization of WSS sites, we will be getting requirements to add different links in the context menu[Edit control block] of list items. There are different ways to do that. However adding this menu item as a feature is really looking cool, following simple feature will make this understand better.

1. Go to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES folder and create an new feature folder called "AddCommunication"

2. Save the following code as feature.xml (update the GUID using GUID generator) into"AddCommunication" folder

3. Save the following code as Add Communication.xml in to the same folder

4. Install the feature.
stsadm -o installfeature -filename AddCommunication\feature.xml

5. Activate the feature
stsadm -o activatefeature -filename AddCommunication\feature.xml -url http://mysharepointsitecollection/

6. Go to your site and check the list item context menu drop down. This should look like the below image

This can be also done by using Java script easily, but for me feature is looking more convenient. I found a good article explaining this in Java script way
http://sizzlingpassion.spaces.live.com/blog/cns!E5CD42098EED7323!266.entry

Apart from the edit item context menu, this kind of links can be added in many menu types available in a WSS site. We need to select the correct group id of the document library or list library. A good microsoft step by step tutorial is available to understand this better.
http://msdn.microsoft.com/en-us/library/ms473643.aspx

No comments: