Start page
Start page

Start page / Templates (basics) / Composition of templates / Format templates / Conversion

Conversion via format templates

Set conversion rule

Apart from the Properties tab, further tabs are displayed for each output channel of the project.

The screen form for each output channel consists of a pull-down list for selection of a conversion rule and an input area for definition of the template.

A conversion rule can be selected from the “Conversion” selection list. Only conversion rules previously installed on the server are displayed in the list (for further information, see Manual for Administrators). The standard conversion rule is “Convert HTML”.

If a conversion rule is selected, this rule is applied to the corresponding output channel of the selected format template only.

Important Precisely one conversion rule can be specified for each output channel.

A conversion rule consists of two blocks; a “convert” block and a “quote” block: “convert” is always evaluated if a conversion rule has been selected for a format template. If “quote” is to be evaluated as well, the “Quote” checkbox must also be selected (see Chapter Properties).

Important The conversion rule will only be applied for the output of CMS_INPUT_DOM or CMS_INPUT_DOMTABLE.
For this purpose the output must be defined via the system object #content, for example via $CMS_VALUE(#content)$.

convert

If "convert" is activated the formatted text for the respective output channel are converted from one character set into the next character set. For example, the conversion rule "Convert HTML" contains the instruction:

0x3c="<"

This means the Unicode area '0x3c' is converted into HTML compatible '<'.

quote

If the “Quote” property is activated the “quote” block is also evaluated. For example the conversion can be changed for specific format templates if, for example, certain characters are to be explicitly displayed on the generated page, e.g. the symbols '<' or '>', which are also displayed in several code examples of the online documentation. The format used for this uses the “quote” property.

Evaluation order of conversion rules

Formatted text

The formatting used by the editor is not always used strictly separated from each other but instead under certain circumstances may also be nested, as shown in the "Formatted Text" figure.

The conversion rules are always evaluated from the inside outwards . As soon as a conversion rule has been applied the corresponding text is deemed to have been converted and is removed from further conversions.

If a format template does not have its own conversion rule, a conversion rule is looked for in the surrounding format templates.

For the example this means: If a conversion rule is set for the "Bold" format template this is applied to the "bold" text. Further conversion rules are then no longer applied to this text.
If no conversion rule has been set for the "italic" format template a conversion rule is looked for in the surrounding section format template and if a rule is available it is used.

Important It is advisable not to use any conversion rules for character format templates (e.g. "bold", "italic") as the expected conversion result can quickly become unclear with multiple nesting.
It is easier to set the conversion via the section templates only.

A special case is the setting of an empty conversion rule for a format template. A text formatted in this way is deemed to be converted, this means no further conversions are carried out, for example via the section format templates. The characters are adopted in the respective output channel just like they were entered by the editor. Such an empty conversion rule can be useful, for example for the output of source texts.

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2014-03-27