SharePoint 2010: Ribbon Customization – Adding button in Editing Tool Tab

Scenario:

When a user click in Content Editor web part, a button appear in the “Editing Tool -> Insert” tab.

Resolution:

Following XML did the trick and we deploy it as feature.

<CustomAction
Id=Ribbon.Add.Button

Location=CommandUI.Ribbon>

    <CommandUIExtension>

      <CommandUIDefinitions>

        <CommandUIDefinition
Location=Ribbon.WikiPageTab.PubPageActions.Controls._children>

          <Button

          Id=Ribbon.WikiPageTab.PubPageActions.AddLinkButton

          Sequence=22

          Image16by16=/_layouts/images/PPEOPLE.GIF

          Image32by32=/_layouts/images/PPEOPLE.GIF         

          Command=AddLinkButton

          LabelText=Add Link Button

          ToolTipTitle=Add Link Button

          ToolTipDescription=Create link.

          TemplateAlias=o2 />

        </CommandUIDefinition>

        <CommandUIDefinition

        Location=Ribbon.WikiPageTab.Scaling._children>

          <MaxSize

            Id=Ribbon.WikiPageTab.Scaling.PubPageActions.MaxSize

           Sequence=15

            GroupId=Ribbon.WikiPageTab.PubPageActions

            Size=LargeLarge />

        </CommandUIDefinition>

      </CommandUIDefinitions>

      <CommandUIHandlers>

        <CommandUIHandler
Command=AddLinkButton
CommandAction=javascript:AddLinkButton();
EnabledScript=javascript:returningtrue(); />

      </CommandUIHandlers>

    </CommandUIExtension>

  </CustomAction>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: