Question

How do you hide out-of-the-box entries from the Markup Styles definitions in the rich text editor in the ribbon in SharePoint 2010?

I know how to add new entries using CSS, but not how to hide the ones that are already there.

(Certainly modifying the corev4.css in the SharePoint root is not the way to do this.)

Was it helpful?

Solution

Each RichHtmlField can be customized to use a different set of markup styles, using the PrefixStyleSheet property. This way, the Rich HTML Field can be made to not use the built-in markup styles from the SharePoint OOTB style sheet, but any set of styles from any other style sheet.

<PublishingWebControls:RichHtmlField
    id="Content"
    FieldName="PublishingPageContent" 
    PrefixStyleSheet="my-rte" 
    runat="server"
    />

OTHER TIPS

I am currently trying to figure this out myself.

An option i am exploring is not using:

<SharePoint:CssLink ID="CssLink1" runat="server" Version="4"/>

and instead create a copy of the coreV4.css file and include it seperately. My custom CSS file takes care of everything except the ribbon, therefore i could leave all the ribbon specific CSS in the copied file but remove any references to markup styles i do not want.

As i say, this may be an option but is untested

I've inherited the cssLink object used in the masterpage (that's the one responsible for injecting all the oob css references) and changed the reference to the controls.css, core4v.css (or any) to my project-specific locations with similar files.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top