Tuesday, February 1, 2011

How to identify a Ribbon control ID

A frequent question I get during my “How to develop for the SharePoint Ribbon” session is:

How can I identify and existing ribbon control or group ID?

This is useful when you wish to override, hide a control, or insert new controls into an existing group / new groups into an existing tab.

So, this task is pretty simple once you know this trick:

First, open a page and make your ribbon control visible:

image

Second, use IE developer tool bar to select the ribbon button you want:

image

 

Climb up the HTML to the span container, the span ID will have the ribbon control ID:

image

In my case, for the wiki page “email a link” here is what we get:

Ribbon.WikiPageTab.Share-LargeLarge-0-0

So, the control ID will be:

“Ribbon.WikiPageTab.Share”

And there you go!

No comments: