0

I want to remove ribbon entry for one the content type. OOTB if you add any content type it will create a button entry in "New Document" Ribbon. I don't want this entry for one specific content type.

Attaching image for better understanding.

enter image description here

I want to remove this "Link to a large document" button.

This is what I already tried

  <CustomAction
  Id="CustomIdentifier.Ribbon.Documents.New.NewFolder.Hide"
  Location="CommandUI.Ribbon"
  RegistrationType="ContentType"
  RegistrationId="0x01010A0096AF48B1B8374FD7B47D6A8C8E711F4E">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.Documents.New.NewDocument.Menu.ContentTypes">                    
        </CommandUIDefinition>
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
  • Why not just remove is from the content types on the list, or changing the order of the new button? Custom action seems like a strange approach here. – Robert Lindgren Dec 12 '13 at 16:53
  • I want this content type in the list, so cant delete it I am not sure what do you mean by changing the order – Ahmed Masud Dec 12 '13 at 16:58
3

Just hide the Content Type from the button:

Go in to List Settings and click on "Change new button order and default Content type" under the Content Types headline.

Set "Visible on new button" to false for your unwanted content type. Absolutely no need for a custom action

More information: http://bernado-nguyen-hoan.com/2010/12/08/content-type-visibility-in-document-libraries/

And, if you like to use code, set this property to false SPContentType.Hidden: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontenttype.hidden.aspx

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.