Here I am going to show, how to create Site Action Menu Customize in Sharepoint site.
For that we have to know that what is custom action ?
Custom actions are links, toolbar buttons and menu items that you can add to or hide from the SharePoint's user interface. Each custom action exists in a specific location, and depending on that location, can be a part of a group of actions.
With a custom action feature, you can:
- Add a new Custom Action Group which can be used to group custom actions in a specific options screen;
- Add a new Custom Action which can be a new option in a settings screen, a new menu item, or a new toolbar button;
- Hide an existing Custom Action whether that action is the result of custom action feature or it belongs to SharePoint's out-of-the-box features.
Now we start Customize SiteAction Menu For that we have make two XML file Like Feature.xml and Element.xml.
I will only present a simple feature manifest; you can put your xml file on C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES path within New Folder. Like: UserInterfaceCustomActions folder pastes that feature.xml file.
<? xml version="1.0" encoding="utf-8" ?>
Title="My Custom Action Feature"
Description="Adds Custom Actions to the Web Site."
Notes about this feature manifest:
- The title of the feature is My Custom Actions Feature.
- It will be deployed as a Web Site feature, since its Scope value is Web.
- It references a single element manifest file: CustomActions.xml.
The element manifest file can have any name you wish (in this example it's called CustomActions.xml), but it's root element must be <Elements>. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of three feature elements:
- <CustomActionGroup> used to create new custom action groups;
- <CustomAction> used to create new custom actions;
- <HideCustomAction> used to hide existing actions.
<?xml version="1.0" encoding="utf-8" ?>
<!-- Custom Action Group -->
Description="This group contains all my custom actions."
Title="My Action Group"
<!-- Custom Action in Custom Action Group -->
Description="This link is a custom action."
Title="My Custom Action"
<UrlAction Url="~sitecollection/_layouts/MyCustomPage1.aspx" />
<!-- Custom Action in Site Actions Menu -->
Description="This menu item is a new custom action."
Title="My New Custom Action"
<UrlAction Url="~sitecollection/_layouts/MyCustomPage2.aspx" />
<!-- Hide Custom Action -->
In command prompt, type the following commands to install the Feature in the deployment, activate the feature on a specified sub site, and then reset Microsoft Internet Information Services (IIS) so that the changes can take effect
- stsadm -o installfeature -filename UserInterfaceCustomActions\feature.xml
- stsadm -o activatefeature -filename UserInterfaceCustomActions\feature.xml -url http://Server/Site/Subsite
Now you can open the site which gave URL in above command no. b and then go to site Action menu on left hand side on site and show your custom site action menu like My New Custom Action.
Now Enjoy with the Customize Site Action Menu.