Start page
Start page

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

Output of formatted texts

Output Channels Format Template tab

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 the output of a Conversion rule and an input area for the template definition (see Figure: “Output Channels Format Template tab”).

The template developer must define the output for each output channel of a format template in the “Templates” area so that the formatted contents of the DOM input component are visible in the respective output channel.

#content system object

The template developer can use the #content system object for the output of contents from a DOM input component. The content of the input component is obtained via the #content system object and is output in the relevant output channel via the Instruction $CMS_VALUE(...)$ in the template area of the format template.

The content can be very different depending on the type of format template involved. For the HTML output channel it could, for example, be editorial contents in the form of pure text or text and HTML tags or HTML tags only (special case: “LineBreak”).

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

Example: "Standard" paragraph format (HTML output channel)

DOM Editor

The editor enters a paragraph within the DOM Editor which is formatted as “Standard” paragraph (abbreviation: “p”) (see Figure: “DOM Editor”). The following is defined in the template area of the HTML output channel for the “Standard” section format template:

<p>$CMS_VALUE(#content)$</p>

The "#content" object is now used to read out the content of the input content and it is formatted for the "Standard" section format template via a <p> tag (as default setting for this format template). The HTML output is then as follows:

Format templates DOM HTML 1

Example: "LineBreak" format template (HTML output channel)

 

Apart from the standard section format there are also format templates which do not output editorial texts but instead output HTML tags only. Such a special case is, for example, the format template for the line break "LineBreak" (abbreviation: "br"). This format template is not explicitly selected by the editor but instead is always used if the key combination "Shift" + "Return" is used within the DOM input component:

The following is defined in the template area of the HTML output channel for the "LineBreak" format template:

<br>

The HTML output (based on the example given above) is then as follows:

Format templates DOM HTML 2

Example: nested format template (HTML output channel)

Nested evaluations are of course also possible. For example, if the editor enters the following text:

The inner-lying format templates "LineBreak":

<br>

and "Bold" are evaluated first:

<b>$CMS_VALUE(#content)$</b>

Then the surrounding section format template "Standard":

<p>$CMS_VALUE(#content)$</p>

This means the "#content" object of "Standard" affects the content of the whole section, i.e. including the content of the "#content" object of "Bold" ("This is a text.") and the tag <br> of the "LineBreak" format template.

The HTML output (based on the example given above) is then as follows:

Lists and tables created by using CMS_INPUT_DOM can be enclosed in the output by tags which derive from a format template.

Available from FirstSpirit Version 5.1R3 If this not desired, the method .normalize can be used from FirstSpirit version 5.1R3 on to suppress the enclosing tags.

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