Saturday, September 27, 2008

URL Action parameters while creating an Custom Feature

While we have creating custom features for adding new menus in the Edit Context Menu (the menu that pops up when you place the mouse on a list item) you might need to specify the

You might notice the parameters like {SiteUrl},...here is the list of possible query string parameters and their description

{ItemUrl} - URL of the item being acted upon. Only work for documents in libraries.

{SiteUrl} - URL of the Web site (SPWeb).

{ListId} - GUID that represents the list.

{RecurrenceId} - Recurrence index. This token is not supported for use in the context menus of list items.

{ItemId} - Integer ID that represents the item within a list.

Note: You can also use the following parameters to get the link of current Site / Web without hardcoding it in the XML File

Windows SharePoint Services supports the following tokens with which to start a relative URL:

~site - Web site (SPWeb) relative link.

~sitecollection - site collection (SPSite) relative link.

Eg: