Sample: Add Ribbon Button to Content Type

Adds a Button to a Content Type specific ribbon.

Recipe Description

In this sample a custom ribbon button is added to the edit form of the content type Document (0x0101). The following code adds the button to the actions group.
            LabelText="ContentType Button"
            ToolTipTitle="ContentType Button"
            ToolTipDescription="Description of ContentType Button"
            TemplateAlias="o2" />
          CommandAction="javascript:alert('Hello, world');" />



Name Description
General Settings
Name Required Text. Specifies the name of the button control.
Title Required Text. The text to label the control.
Description Required Text. The text that appears as the description of the tooltip.
Sequence Required Integer. An integer that specifies the order of placement among sibling XML nodes.
Optional Permission Settings
Rights Optional Text. Specifies a set of rights that the user must have in order for the link to be visible. If not specified, then the action always appears in the list of actions. The set of rights are grouped logically according to AND logic.
Require Site Administrator Optional Boolean. TRUE to specify that the item be displayed only if the user is a site administrator; otherwise, FALSE. Using the RequireSiteAdministrator attribute for the drop-down menu of Windows SharePoint Services commands associated with list items is not supported.
Form Settings
Custom Action Location Required Text. Location element of the custom action.
Optional List Settings
Content Type Select the content type where the action should be added.
Location Settings
Parent Ribbon Group Required Text. Specifies the existing ribbon group into which the new button should be added.



  • Torsten Mandelkow

Version history

  • 1.0 Initial Recipe