3

This question is for anyone who wants to add a custom button to the Ribbon under the WikiPage or PublishTab tabs. The methods out there for adding a button that is associated with a list or library or file type do not seem to work for this particular scenario. The Button simply doesn't appear.

Here is the XML I am trying recently:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
    Id="Ribbon.PublishTab.Publishing.CheckLinkedPageItems"
    Location="CommandUI.Ribbon"
    RegistrationType="List"
    RegistrationId="850"
    Sequence="40"
    Title="Move Documents">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.PublishTab.Publishing.Controls._children">
          <Button
            Id="Ribbon.PublishTab.Publishing.CheckLinkedPageItemsButton"
            Alt="Check Linked Page Assets"
            Sequence="40"
            Command="CheckLinkedPageItems"
            Image32by32="/_layouts/images/ita/CheckLinked32.png"
            Image16by16="/_layouts/images/ita/CheckLinked16.png"
            LabelText="Check Assets"
            TemplateAlias="o1"
            ToolTipTitle="Check Linked Page Assets"
            ToolTipDescription="Checks each image, document and page linked to from this page and verified if the asset is both working (not a broken link) and published. You may also use that page to publish all unpublished assets at once."
            />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="CheckLinkedPageItems" CommandAction="javascript:alert('button clicked!);" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

I've tried several different combinations of RegistrationId and RegistrationType with no avail.

So far I've tried:

  • List / 101
  • List / 850 (id for Pages Library)
  • FileType / aspx
  • ContentType / 0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF39 (ContentTypeId for 'page' content type)

Has anyone actually gotten this to work? Thanks!

2 Answers 2

2

Well, it looks like all the examples out there are wrong, at least in this particular case. The TemplateAlias attribute needs to be c1, not o1.

Hope this helps someone.

1
  • hello, hitdrumhard.. I am facing same issue for content type but I am not getting custom action placed in the Publish tab...
    – users1100
    Commented Jan 21, 2014 at 11:25
-1

I haven't tried with the RegistrationId but take a look at my blog post for putting it on the edit page

1
  • Your page seems to be down - would you mind posting your solution here? Commented Jun 6, 2014 at 10:21

Your Answer

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

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