[opencms-dev] RE: Stylesheet classes available in WYSIWYG editor?
King, Dennis
DKing at netopia.com
Fri Mar 17 18:54:03 CET 2006
Thanks to the pointer from Christian, I figured out how to do this. The
documentation is in
/system/modules/org.opencms.editors.fckeditor/help/en/customstyles.html.
By creating an XML file into the correct directory with your stylesheet,
you can create styles the FCKEditor uses. It creates an addition toolbar
item which allows you to assign styles to different items. There are
rules to follow to name your .xml: mystyle.css has to have
mystyle.css_style.xml. I haven't confirmed that you can't just create an
arbitrary .xml file, but it seems based on the following problem I saw
that you might.
I got the impression from the help file that by shadowing a .css file
with defined class names with a .xml file, you were allowing FCKEditor
to assign class names and use the appropriate style class defined in
your stylesheet. This turns out not to be true, I think, unless I did
something wrong or missed a step. I copied the sample XML file, used the
naming convention, updated the style settings in the XML to match those
in the .css file, and found that FCKEditor had the functionality to
apply the styles from the toolbar. However, in reviewing the source code
of a published file, I see that the style was applied statically using a
style attribute of the tag with values like "font-weight: bold" copied
from the XML, rather than a simplme class attribute like <span
class="myBold"> referring to the definition in the .css file. This seems
to mean that my .css file is useless; I can't change a class definition
in a .css file and have that change appear throughout the site because
local instances of the XML style definitions are used instead. This
would seem to be something FCKEditor might be able to improve upon.
If anyone has any corrections to his, I'd be happy to be proved wrong.
Best,
Dennis
________________________________
From: King, Dennis
Sent: Wednesday, March 15, 2006 5:27 PM
To: 'opencms-dev at opencms.org'
Subject: Stylesheet classes available in WYSIWYG editor?
Hi All,
I've been setting up templates in my 6.2 beta install to test the
end-user experience. I imported stylesheets to the /resources directory
of my module and linked to them from the template using the <cms:link>
tag inside an HTML <link> tag per the documentation. The published page
uses the stylesheets. However, in the editor, I have not found a way to
use the classes defined in the stylesheets except to edit source and add
class attributes by hand. Is there a way to enable the WYSIWYG editor to
know about the styles available and allow the user to set styles to
highlight portions of the HTML being edited? This seems very important
to me if I'm to enforce a style guide site-wide.
Thanks!
Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060317/24f597f6/attachment.htm>
More information about the opencms-dev
mailing list