6

I'm looking for the location of SharePoint ribbon XML for List Views. I'm just curious to see how Microsoft has coded it. However, I don't know the location of the xml file. Could someone put me in the right direction?

Thanks!

5

All the ribbon definitions are stored in this file:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL\XML\CMDUI.XML

Action JS code for most of these ribbon elements you can find here:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.Ribbon.debug.js

Actions for rich text editor ribbon are stored here:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.UI.Rte.debug.js

2
  • Can not find there SPD created Custom Action Buttons. Is there separate folder/files for those? – przemo_li Dec 10 '14 at 12:02
  • The ribbon buttons that SPD creates are likely stored somewhere in database. You can fetch them via API. Get your SPList object first, and then explore UserCustomActions property. This can be done e.g. via PowerShell. For more details, please ask a separate question. – Andrey Markeev Dec 21 '14 at 1:17
2

Copy the following XML into Feature's Elements.xml and try to play with params. The location is CommandUI.Ribbon.ListView

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
  Id="ShowHelloWorldButton"
  RegistrationType="List"
  RegistrationId="100"
  Location="CommandUI.Ribbon.ListView"
  Rights="EditListItems">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
         Location="Ribbon.ListItem.Actions.Controls._children">
          <Button
           Id="Ribbon.ListItem.Actions.Controls.ShowHelloWorldButton"
           Alt="Show HelloWorld Alert"
           Sequence="1"
           Image32by32="/_layouts/DemoSharePointRibbon/HelloWorld.jpg"
           Command="ShowHelloWorldCommand"
           LabelText="Hello World"
           TemplateAlias="o1"
           CommandType="General"/>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
         Command="ShowHelloWorldCommand"
         CommandAction="javascript:alert('Hello World');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

Location of Ribbon XML file is :

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL\XML\CMDUI.XML

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.