Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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;}"

share|improve this answer
    
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 '12 at 13:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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