views:

220

answers:

2

Preface/Environment: I'm using fckEditor, asp.net MVC, and jquery

Our site has a set of sitewide styles. They include fonts, lists, and certain other basic functions.

body
p
a
ul
ul li
div.content
etc....

The problem comes in with our CMS. We're using FCK editor, and saving the content changes to a database which are then served to content pages. The problem is that the behavior is nothing at all towards what the user would expect. Their changes are affected (of course) by the sitewide styles. The problem is that in all cases the user wants their choices to override the sitewide styles. Unfortunately if they choose something who's default behavior is different from our site, then it comes out wrong. Ex: We've overridden UL and LI. If they choose a list in FCKEditor, then it doesn't apply any style, and the default is then what our site defines, not what the user wanted (ie, the default LI appearance).

Is there any way around this other than to update every other part of the site to be more specific so that the defaults aren't changed?

A: 

Prevent your main site's CSS from being used with their pages. CMSs (e.g. Joomla, MODx) often have an option to select one style or none at all for individual pages. Your users' pages can also default to a blank style.

mcandre
That might work. I could have three .css files. One for the wrapper (master pages in asp), one for non-CMS pages, and one for CMS pages. it would be fairly easy to specify .css at run time with mvc.
Russell Steen
We do something similar. We wrap the CMS-injected content in a div, such as #user-content, and then provide nice default styling (for example, UL's and LI's that appear as our users expect) for all of the common elements within this div. (We do this within the same stylesheet as our main CSS, just with #user-content prepended in front.) Mind you, we have also stripped out several of the "formatting" items from the FCK's toolbars, so that users cannot change their own color or font-face etc. We prefer them to use the headings and styles we've defined for them. Good luck! -f
Funka
A: 

use '!important' for style attributes? (ie. background-color: Black !important ). May be a bit tedious but this is what I use to override default styles on some pages. Just a suggestion, it may not apply since your editing through a CMS.