SP2010: How to create a new button in the ribbon
I have some problems adding a new custom button to the ribbon. As explained in the sharepoint 2010 SDK (How to: Modify the User Interface Using Custom Actions), i've created a visual studio project and copied the xml code which should create the new button. Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="ListViewCustomization" Location="CommandUI.Ribbon.ListView" RegistrationId="101" RegistrationType="List" Title="List View Ribbon Customization">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.Documents.Share.Controls._children">
<Button Id="ListViewButton" Command="ListViewButtonCommand" Description="Go to Settings" LabelText="Site Settings" TemplateAlias="o2" Sequence="93"/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
开发者_JAVA技巧 <CommandUIHandler Command="ListViewButtonCommand" CommandAction="/_layouts/settings.aspx" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>
I've checked the site settings of my site collection, and the new feature results activated, but no new button around. Am i missing some steps?
If I follow the steps, I see a button in the ribbon under "Share & Track" group.
I hope you are checking in a Document Library and not anywhere else. Remember, you have customized only the document library by specifying RegistrationId="101" in the xml file.
Are you sure the button is not there?
I followed instructions from the How to: Modify the User Interface Using Custom Actions article and here's the result:
精彩评论