How to add Styles or Markup Styles to the drop-down-lists in the SharePoint 2010 ribbon

I found a very useful blog post from SharePointRoot the other day that allowed me to provide some custom styles to a client for their SharePoint 2010 platform. They loved it as it gave them a whole load of bespoke formatting options without having to delve in to code.

The basic process involves creating a class in your CSS that is named using “ms-rteStyle” as a prefix will place theĀ element as an entry in your Styles drop-down-list in the ribbon.

Creating a class with the prefix “ms-rteElement” will add it to the Markup Styles drop-down-list in the ribbon.

I don’t yet know the difference between the two (perhaps somebody can enlighten me) and it’s a shame that SharePoint requires the use of -ms-name: as this will cause validation of the CSS to fail, but despite that it’s a very easy method of extending the content owner’s control over their site, which has got to be a Good Thing, hasn’t it?

An example:

.ms-rteStyle-MyNewTitle {
-ms-name:"This is a Style";
color: red;
}

or:

.ms-rteElement-MyNewTitle {
-ms-name:"This is a Markup Style";
color: red;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>