[opencms-dev] Apply an CSS to editors

Christian Steinert christian_steinert at web.de
Thu Jul 6 09:07:12 CEST 2006


Mr Alireza Fattahi schrieb:
> Hi,
> 
> Imagine that we are editing an Html page with fckeditor, and we want to add a css to it. Is it possible?
> Can we configure fckeditor to display a Html with an attached css.
> 
> What about other editors? Do they support CSS while you edit content of pages?
> 
> Regards,
> Alireza Fattahi
> 

Yes, you can use an own stylesheet.

The effects of this stylesheet are already visible while editing and you 
can add styles of your CSS to the styles dropdown list of FCKedit.

1. To link a CSS file with the editor, you write the path of your CSS 
file into the "template" property of your JSP template. (Not very 
intuitive, but it works). After this the CSS is used for display in the 
editor.

* it's also explained a bit here: 
http://mail.opencms.org/pipermail/opencms-dev/2006q1/021777.html


2. Now you need an additional XML file that configures, which styles of 
the CSS file should be available in FCKeditor

* and about the XML-File you need to create it says something in the 
Javadocs: 
(http://www.opencms.org/export/javadoc/modules-workplace/org/opencms/editors/fckeditor/CmsFCKEditor.html)
______________________________
  "This editor supports user defined styles. To show these styles, a 
plain text file containing the style definition XML code has to be 
placed in the same folder where the template CSS style sheet is located.
The file name has to be exactly like the file name of the CSS with the 
suffix _style.xml added. E.g. for the CSS file style.css the style 
definition file has to be named style.css_style.xml."

An example for a style XML can be found in the VFS file 
/system/workplace/resources/editors/fckeditor/fckstyles.xml.
______________________________


Regards,
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060706/90e91f81/attachment.bin>


More information about the opencms-dev mailing list