Here’s a quick tip related to the rich text editor in Sitecore. In 6.4 the telerik rad control was added, via specific style sheets you can expose css classes for the content editor to use.
Mark Stiles has blogged about this here.
These approaches works fine but what if you want the styles to be dynamic ie a content editor can add and remove them?
The solution
- You setup some items in your tree which represent CSS classes (name and required styles).
- You then create an httpHandler which sets its content type to be CSS.
- In your handler you expose all the CSS styles from the tree and render to the output (you may need to explicitly select which db to use in the handler since the requests may not run through all the sitecore pipelines). If needs be you could stream through the styles from the physical existing web stylesheet as well.
- You then point the WebStylesheet setting at your new handler.
Remember, you need to include the CSS link tag in your layout which points to your handler otherwise the classes won’t exist in the front end.