When creating sites in SharePoint and especially when you’re adding custom functionality to the site – you often need to add a way for content authors and administrator to be able to change some of the system behavior through exposing options and some soft of the configuration interface.
In many cases you can use a list or a web part, but in some cases, especially when changes you’re making are more global and affect few site collections and web applications – it might make sense what SharePoint does in such cases: expose configuration through a Central Administration user interface.
If you worked with extending SharePoint user interface before you know that SharePoint allows inserting additional UI elements in a pre-defined parts of its interface using Features and CustomAction paradigm.
Let’s take a look at how you can add a new option to Application Management tab of a Central Administration as shown below:
1. Create a new feature scoped to a Farm since this is our farm feature:
<?xml version=”1.0″ encoding=”utf-8″ ?>
<Feature xmlns=”http://schemas.microsoft.com/sharepoint/”
Id=”F2B2CAD4-66FB-4f29-90A5-153A8FA1A835″
Title=”My Admin Config”
Description=”Provision custom SharePoint Central Administration settings”
Version=”1.0.0.0″
Scope=”Farm”
Hidden=”FALSE”
ActivateOnDefault=”FALSE”
AlwaysForceInstall=”TRUE”
><ElementManifests>
<ElementManifest Location=”Elements.xml” />
</ElementManifests>
</Feature>
2. Now, the feature uses Elements.xml to provision it’s options. The contents below:
<?xml version=”1.0″ encoding=”utf-8″ ?>
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
<CustomActionGroup Id=”Yaroslav.Configuration”
Location=”Microsoft.SharePoint.Administration.ApplicationManagement”
Title=”Yaroslavs Configurations”
Sequence=”10″/>
<CustomAction Id=”Yaroslav.Configuration.ConfigurationPage”
Location=”Microsoft.SharePoint.Administration.ApplicationManagement”
GroupId=”Yaroslav.Configuration”
Title=”Farm Settings”>
<UrlAction Url=”/_layouts/Yaroslav/MySettings.aspx” />
</CustomAction>
</Elements>
Above, most of the options are self explanatory. CustomActionGroup defines the group name and arbitrary ID; that ID is later on used in CustomAction where our actual link is constructed and used under the group category. The page in this case _layouts/MySettings.aspx is a value of the page that will handle all of the setting provisioning. This is just an ASPX page that gets a hold of SharePoint object model to drive the settings – so I won’t be covering it here.
Once you deploy the feature and open your Central Administration application management tab – you will see your new category added.
Check out more details on this at MSDN (http://msdn.microsoft.com/en-us/library/ms465980.aspx)
Good Luck!
