开发者

SP2010: How to create a new button in the ribbon

开发者 https://www.devze.com 2023-01-20 09:50 出处:网络
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 a

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:

SP2010: How to create a new button in the ribbon

0

精彩评论

暂无评论...
验证码 换一张
取 消