[opencms-dev] Persuading FCKEditor to use default style for content

Jonathan Woods jonathan.woods at scintillance.com
Tue Sep 19 11:56:53 CEST 2006


Christian -

I wasn't being very clear, and in any case I've spotted an obvious
workaround.

My concern was that the mark-up generated by FCKEditor isn't very
controllable.  I wanted to ensure that it did not generate class-less
<div>s, but instead generated <div>s which were always given an explicit
class (of which the default might be called 'Normal paragraph').

Of course, I realise now that I can achieve the same end result by making
sure that all free-form content is contained in an outer <div> generated by
the template, and by defining a CSS rule which matches content within that
div:

Template:

	<div>Template stuff preceding freeform content here</div>
	<div class="freeformContent">
		[include an FCKEditor-derived element from the
'body'/instance]
	</div>
	<div>template stuff following freeform content here</div>

CSS matching at rendering time:

	/* Rule to match unclassified divs: */
	.freeformContent div {
		margin: 1em 0em 1em 0em;
	}

CSS matching at editing time (cited by FCKEditor), in which context the
enclosing .freeformContent div is not present:

	div {
		margin: 1em 0em 1em 0em;
	}

Jon

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Christian Steinert
Sent: 18 September 2006 19:12
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Persuading FCKEditor to use default style for
content

Dear Jonathan,

I don't know if I understand your question correctly, but why can't you just
apply that style in your template itself?

If somebody nests additional styles/divs inside the DIV that comes from the
template, then the inner DIVs will overwrite all relevant properties of the
content they contain. Such an approach would only be problematic, if your
"myDefaultStyle" uses borders, margins, or other things that cannot be
over-ruled by a contained element.

"...it wouldn't even be possible to generate bare <div> mark-up."
=> this part I don't understand, sorry - please elaborate...

hth somehow - if not, please ask again.
Christian


> I've configured FCKEditor to define a set of appropriate house styles -
thanks to Andreas Zahner, Kai Schliemann and others on this list for
pointers.
> 
>  
> 
> Is there a way to persuade FCKEditor to use one of these by default?  At
the moment, my client's content is being authored using anonymous <div>
blocks.  Ideally <div>s would be styled as <div class="myDefaultStyle"> and
it wouldn't even be possible to generate bare <div> mark-up.
> 
>  
> 
> Jon
__________________________________________________________________________
Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach!

Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=021131


_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your
list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list