HtmlWidget

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 +
See also [[FCKEditor]]
 +
 
== Description ==
 
== Description ==
 
Shows a WYSIWYG text area with formatting options to create formatted texts. This is the default widget for the [[OpenCmsHtml|OpenCmsHtml datatype]].
 
Shows a WYSIWYG text area with formatting options to create formatted texts. This is the default widget for the [[OpenCmsHtml|OpenCmsHtml datatype]].
Line 27: Line 29:
 
   <layout element="Text" widget="HtmlWidget" configuration="css:/system/modules/MODULE_NAME/resources/css/my.css,stylesxml:/system/modules/MODULE_NAME/resources/css/my.css_style.xml, ... OTHER OPTIONS" />
 
   <layout element="Text" widget="HtmlWidget" configuration="css:/system/modules/MODULE_NAME/resources/css/my.css,stylesxml:/system/modules/MODULE_NAME/resources/css/my.css_style.xml, ... OTHER OPTIONS" />
 
  </layouts>
 
  </layouts>
 +
 +
== External References==
 +
* The [http://www.opencms.org/javadoc/core/org/opencms/widgets/CmsHtmlWidgetOption.html javadoc of class CmsHtmlWidget] lists all configuration settings that can be used for the HTML editor widget of resources that use a xml content resource type
 +
* [http://www.nabble.com/FCKEditor-and-XML-content-t3524856.html Discussion on how to add CSS styles to the HTML editor of xml content types] (discusses additional config settings "css:" and "stylesxml:")

Revision as of 18:19, 13 October 2007

See also FCKEditor

Contents

Description

Shows a WYSIWYG text area with formatting options to create formatted texts. This is the default widget for the OpenCmsHtml datatype.

Extending edit options for HtmlWidget

It is possible to extend the HtmlWidget that is used by the XMLContent forms so that the different OpenCms galleries can be accessed for creating nice html. This is quite easily done by opening up the XML Schema file for the XML Content type you wish to extend, and add the following code:

<layouts>
  <layout element="Text" widget="HtmlWidget" configuration="source,link,anchor,formatselect,imagegallery,downloadgallery,linkgallery,htmlgallery,tablegallery,height:400px" />
</layouts>

inside the following tags:

<xsd:annotation>
  <xsd:appinfo>
    ... Add the layouts element here ...
  </xsd:appinfo>
</xsd:annotation>

Of course you can modify the configuration attribute to display only the extra elements you would like to make available to the content creators.

Adding a style box with your custom styles

It is possible to add a style box with your custom styles to the FCKEditors toolbar. First, set up your stylesheet and the configuration xml file in the resources directory of your module. You find a description how to do this on page FCKEditor. Then reference the stylesheet and the configuration xml in the configuration attribute of the layout element

<layouts>
  <layout element="Text" widget="HtmlWidget" configuration="css:/system/modules/MODULE_NAME/resources/css/my.css,stylesxml:/system/modules/MODULE_NAME/resources/css/my.css_style.xml, ... OTHER OPTIONS" />
</layouts>

External References

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox