1

I have created one content type inheriting from Pages content type, and applied it to Pages library in publishing web.

I want to hide the Publish button from the ribbon. To do so, I have created one custom action which contains following code.

<CustomAction
Id="RemovePublishButton"
Location="CommandUI.Ribbon"
RegistrationId="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900D9A1C3A07CE50544B51A08234D0D26DE"
RegistrationType="ContentType">
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition
      Location="Ribbon.PublishTab.Publishing.Publish" />
  </CommandUIDefinitions>
</CommandUIExtension>
</CustomAction>

I have referred this link for hiding button from ribbon. But unfortunately, it is not getting invisible. I have corrected the location form this MSDN link also.

What am I missing?

1

After googling I found one solution that if we omit RegistrationId and RegistrationType attributes from <CustomAction>, we can hide the button. The actual reason behind this is not yet clear to me but working like charm!!! Now my custom action is containing following code.

<CustomAction
Id="RemovePublishButton"
Location="CommandUI.Ribbon">
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition
      Location="Ribbon.PublishTab.Publishing.Publish" />
  </CommandUIDefinitions>
</CommandUIExtension>
</CustomAction>

Hope this helps others too!!!

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.