[opencms-dev] Structure content html editor configuration

Tomáš Adámek tomas.adamek at qbizm.cz
Fri Jun 2 12:47:16 CEST 2006


Hello,

I just found another "hidden" feature in OpenCms source code, dont know 
if this was mentioned before or not, if so, sorry for bugging ya.

There is a simple way how to configure wysiwyg html editor widget used 
in structure content documents. There are some options in XML schema 
definiton, which can enhance editor menu bar.

height: editor window height
link: link dialog button
anchor: anchor dialog button
formatselect: text format select box (<p>, <h1> and <div> tags)
source: show gallery dialog button (name of gallery - imagegallery, 
downloadgallery etc)

This configuration params are defined in xml structure definition in 
layout element:

<layout element="Name" widget="HtmlWidget" 
configuration="height:200px,formatselect,source" />

Check complete syntax in example below:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified">
	
   <xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>

   <xsd:element name="Editors" type="Editors"/>
	
   <xsd:complexType name="Editors">
     <xsd:sequence>
       <xsd:element name="Editor" type="OpenCmsEditor" 
maxOccurs="unbounded"/>
     </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="OpenCmsEditor">
     <xsd:sequence>
       <xsd:element name="Content" type="OpenCmsHtml" />
     </xsd:sequence>
     <xsd:attribute name="language" type="OpenCmsLocale" use="optional"/>
   </xsd:complexType>

   <xsd:annotation>
     <xsd:appinfo>
       <resourcebundle name="class"/>
       <preview uri="${previewtempfile}" />
       <mappings />
       <layouts>
         <layout element="Editor" widget="HtmlWidget" 
configuration="height:200px,formatselect,source" />
       </layouts>
       <validationrules/>
       <defaults />
     </xsd:appinfo>
   </xsd:annotation>
</xsd:schema>

- enjoy

-- 
Tomas Adamek                                Qbizm technologies, a.s.
analyst-developer                           ... the art of software.
____________________________________________________________________
www.qbizm-technologies.cz    www.qbizm.cz      www.qbizm-services.cz



More information about the opencms-dev mailing list