Friday, September 19, 2008

Creating Custom WCM Styles

When creating content on a publishing site through a Page Content HTML editor there are some basic styles that come OOTB: The styles are actually conditional and different styles appear based on the type of content selected.

Text:

  • Article By Line
  • Article Head Line
  • Article Title



Pictures:



Lists:

  • Square Bullet List (Only for un-numbered lists)


  • Roman Number List (Only for numbered lists)



Links:

  • Link Style

You can view the OOTB styles by going to "http://yourportalsite/_layouts/1033/styles/HtmlEditorCustomStyles.css"

There is also the option of using the paragraph formatting dropdown to style your content.



So how do you create your own custom styles?

  1. First you will have to create your own custom CSS file.
  2. Then you need to know how to classify your content. Use the following attribute in your custom CSS without the quotes of course. Replace the "yourstylename" with your own custom style name without spaces.
    1. Images: "IMG.ms-rteCustom-yourstylename"
    2. Links: "A:link.ms-rteCustom-yourstylename"
    3. Numbered Lists: "OL.ms-rteCustom-yourstylename"
    4. Un-Numbered Lists: "UL.ms-rteCustom-yourstylename"
    5. Basic text: ".ms-rteCustom-yourstylename"
  3. Note: If you are creating completely new styles they will override the OOTB styles and the examples above will not show. So if you like some of the OOTB style simply copy them over to your new CSS file.
  4. Upload your stylesheet to either the server or a document library, and under site settings set it as an alternate style sheet. Or you could add it to the bottom the core.css file so that it is available globally across all sites.

And that's about it! Good luck styling and let me know if you found this useful!

2 comments:

MeMoNoNo said...

This is great. Many thanks for the help.

Sqiar BI said...

I work on our Professional Services team.We have Business Consultants that can help in several ways. Here are some of services that we offerhttp://www.sqiar.com/solu...
Click on the link of that page to send us an email. We'd be happy to help.
Professional Services
Tableau Software