Monday, June 23, 2008

How to Provision a Link in Site Settings

Have you ever wondered how you could add your own links to the Site Settings area within SharePoint?  If you want to add a link that shows up in that location try this out.  The following is CAML provisioning code that is initiated by a feature.  This assumes you know what SharePoint Features are.

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

    <CustomAction
       Id="MyCustomLink"
       GroupId="SiteCollectionAdmin"
       Location="Microsoft.SharePoint.SiteSettings"
       RequireSiteAdministrator="true"
       Sequence="300"
       Title="Synchronize Root Names">
        <UrlAction
           Url="_layouts/CustomApplicationPage.aspx" />
    </CustomAction>

</Elements>

This will give you a link as shown below:


Location tells SharePoint to target the site settings page.

GroupId tells SharePoint to put the link in the site collection administration section.

Sequence is the position in the list.  If you're not happy with it's position, just change the number.  Lower numbers appear higher in the list.

RequireSiteAdministrator is pretty self-explanitory.  If you're not a site administrator, you won't see the link.

No comments:

Post a Comment