Ribbon in SharePoint 2010 comapring with previous versions of SharePoint is a big change and a vast improvement in the GUI. When You use it for the first time it can be a bit confusing, but You should get used to it very quickly. Very nice function implemented in the newest version of SharePoint is ability to customize nad create Your own Ribbon Buttons. To create such a custom button You have to create a new Feature and deploy it on the SharePoint server.

Buttons can be created for different kind of lists and in different Ribbon Groups. Right now I will show You how to create a Ribbon Button for Custom List placed in the Settings group. For the full list of Ribbon locations go HERE.

First You have to create a new Feature. I will create a Feature which will be activated on a site collection level, which means that after Feature activation all the Custom Lists in the site collection will contain this button:


<?xml version="1.0" encoding="utf-8"?>
<Feature Id="145cea3f-acf2-4166-915a-48174e284ff7"
 Title="Alert Button"
 Description=""
 Version="1.0.0.0"
 Hidden="FALSE"
 Scope="Site"
 DefaultResourceFile="core"
 xmlns="http://schemas.microsoft.com/sharepoint/">
 <ElementManifests>
 <ElementManifest Location="elements.xml"/>
 </ElementManifests>
</Feature>

Now for the Elements.xml:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<CustomAction

Id="CAAlertRibbonButton"
RegistrationId="100"
RegistrationType="List"
Location="CommandUI.Ribbon"
Sequence="5"
Title="Alert Ribbon Button">

<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.List.Settings.Controls._children">
<Button
Id="AlertRibbonButtonId"
Alt="Alert Ribbon Button"
Sequence="5"
Command="CMDAlertRibbonButton"
Image32by32="/_layouts/images/menulistsettings.gif"
Image16by16="/_layouts/images/itdcl.gif"
LabelText="Alert Ribbon Button"
TemplateAlias="o1" />
</CommandUIDefinition>
</CommandUIDefinitions>

<CommandUIHandlers>
<CommandUIHandler
Command="CMDAlertRibbonButton"
CommandAction="javascript: alert('List Id: {SelectedListId}');" />
</CommandUIHandlers>

</CommandUIExtension>
</CustomAction>
</Elements>

The result: