I recently wanted to add some links to the Site Settings page of a SharePoint 2010 server when installing a custom feature. By default there were seven groups available to choose from where I could place my feature related links, on my environment these were as follows:
- Users and Permissions
- Site Administration
- Site Collection Administration
- Look and Feel
- Site Actions
- Reporting Services
When adding new links via a CustomAction it is possible to choose the location for the links by supplying a Location and GroupId attribute in the CustomAction XML. In order to add links to the Site Settings page the Location attribute needs to be set to Microsoft.SharePoint.SiteSettings (a full list of available locations can be found by following the links at the end of this post). Then the GroupId can be set to one of the predefined groups (i.e. SiteAdministration, SiteCollectionAdmin, UsersAndPermissions etc).
I did not however wish to add my links to any existing group, instead I wanted to create a brand new group relating to my new custom feature. In order to create a new group it is possible to add a CustomActionGroup element to the feature’s Elements.xml file as follows.
Title =”Custom Feature Links”
I think the attributes above are reasonably self-explanatory but the important thing to note is the Id attribute. This is the value our CustomActions must use in order to be added to this new group, as follows:
Title=”Custom Feature Settings”>
When the above feature is activated a new group would be created in Site Settings called Custom Feature Links which would have one link beneath it called Custom Feature Settings which links to the /_layouts/CstmFeat/settings.aspx page.
The only other thing to note is that in SharePoint 2010 the CustomActionGroup element can take an ImageUrl attribute and this is the large icon that will be displayed next to the group, in this case on the Site Settings page. It is possible to either use a custom image or reuse one of the existing images supplied with SharePoint.
The following links may be useful for further information about CustomAction and CustomActionGroup usage:
Default Custom Action Locations and IDs
CustomActionGroup Element (Custom Action)