1

I've created a custom document library which is defined through a Visual Studio solution. I also have ribbon customizations which add buttons. My problem is that these buttons do not display on the custom document library which was defined through a Visual Studio solution,; they only display on lists made through the SharePoint interface.

One such custom ribbon button:

<CustomAction
  Id="AddRibbonButton"
  RegistrationType="List"
  RegistrationId="101"
  Location="CommandUI.Ribbon">
  <CommandUIExtension>
    <CommandUIDefinitions>
      <CommandUIDefinition
        Location="Ribbon.Documents.Share.Controls._children">
      <Button
        Id="Ribbon.Documents.Share.CopyPathToClipboard"
        Alt="Copy Path To Clipboard"
        Sequence="10"
        Image32by32="/_layouts/images/CopyPath32x32.png"
        Command="CopyPath"
        LabelText="Copy Path"
        TemplateAlias="o1"
        />
     </CommandUIDefinition>
   </CommandUIDefinitions>
    <CommandUIHandlers>
      <CommandUIHandler
        Command="CopyPath"
        CommandAction="javascript: copyPath();" />
    </CommandUIHandlers>
  </CommandUIExtension>
</CustomAction>

I adding a second copy of this XML and setting the RegistrationId to the ListTemplateId but that didn't work.

If anyone has any advice it would be greatly appreciated.

Thanks.

1 Answer 1

1

Have you used the same value you used for the Type in the List template for the RegistrationId?

You should be able to replace RegistrationId="101" with the List ID of your chosen custom document library. Something like RegistrationId="{$ListId:Lists/MyCustomLibrary;}"

1
  • I was able to get it work with the List ID, but not with the string substitution that you also mention. Is there somewhere where that kind of substitution is documented? Also, is there any way to write the button definition once and have it apply to all of the lists I want?
    – MgSam
    Jul 12, 2012 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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