Custom Action Menu under Site Actions in SharePoint

Adding a custom menu item into “Site Actions” Menu

There may be some scenario when we need to add custom menu item to Site Actions drop down, for doing this we need to add a feature which add the menu. The procedures for this is mentioned below.

1. Create a folder named ‘MyCustomSiteActionMenu’
2. Create feature.xml in that folder and add the following code to the feature.xml and save
<?xml version=”1.0″ encoding=”utf-8″ ?>
<Feature Id=”{NEWGUID}” Hidden=”TRUE”
Title=”Custom Menu Site Action demo feature”
Description=”The feature will add a custom menu item into the Site Actions drop down”
<ElementManifest Location=”elements.xml” />

Replace {NEWGUID} with a newly created GUID – Use Visual Studio ‘Create GUID’ tool for this. (Go to Tools -> Create Guid in IDE)
‘Id’ Any new GUID
‘Hidden’ denotes whether the feature should be listed under Site Features.
‘Title’ denotes the feature title, this will be displayed as the title in feature listing page
‘Description’ denotes the feature description, which will be displayed in the feature listing page
‘Version’ denotes the version
‘Scope’ denotes the feature activation scope. Possible values are Site, Web and Farm
And finally mention the element Manifests of the feature, in this case ‘elements.xml’
3. Create the elements.xml in the same folder and add the below code and save
<Elements xmlns=””>
Title=”Show Javascript Alert”
Description=”Click to see Javascript alert” RequireSiteAdministrator=”True” >
<UrlAction Url=”javascript:alert(‘Hi.. From Site Actions’)”/>
Title=”Redirect to”
Description=”Click to redirect to a url” RequireSiteAdministrator=”True” >
<UrlAction Url=””/>
Refer the MSDN url for more information on the Attributes
‘GroupId’ Value is important if you want to add as Sub menu of another Menu Item
‘Location’ is important as well, because it denotes where the custome menu should be added.
Refer the MSDN url for more information on the Location values
In this post, we are going to add a custom menu to the SiteActions menu so location is ‘Microsoft.SharePoint.StandardMenu’ ‘Sequence’ as the name indicates the ordering of the menu item.
‘Title’ is what we see in the menu item
‘Description’ is also seen just below the menu item title
‘RequireSiteAdministrator’ value indicating whether the menu item will be visible only to Site Administrators
<UrlAction> denotes the action to be performed.
Now we are good enough to deploy the feature.
4. Copy the folder ‘MyCustomSiteActionMenu’ to 12\TEMPLATE\FEATURES
5. Using Stsadm command install the feature.
Using Command Prompt, go to the folder 12\bin and then execute the following command
STSADM -o installfeature -name ‘MyCustomSiteActionMenu’
Wait for message “Operation Completed Successfully.”
6. Using Stsadm command activate the feature (The feature is Hidden so it wont be seen in the features listing).
STSADM -o activatefeature -name “MyCustomSiteActionMenu” -url “http://localhost”
Wait for message “Operation Completed Successfully.”
7. Done – Go back to the page, refresh to find the newly added custom menu.

Custom Action Menu under Site Actions in Sharepoint

Custom Action Menu under Site Actions in Sharepoint

Leave a Reply

Your email address will not be published. Required fields are marked *