Start page / Template development / Template syntax / System objects / #content

#contentAvailable from FirstSpirit Version 4.0

The system object #content is available within format templates. It is used to read out the content of the input components CMS_INPUT_DOM or CMS_INPUT_DOMTABLE.

CMS_INPUT_DOMTABLE

#content can be used to output the content of a table cell (Dom table) or of a section (DOM editor).

The content of a table cell is either output via the format template with the abbreviation td or with the help of the Table function. The content of a DOM editor is output via a format template with activated Section option (e.g. the format template with the abbreviation p).

Example: The output of the table content in the graphic with #content

  • of the 1st cell in the 1st row is: 1st row,<br>1st column
  • of the 2nd cell in the 1st row: 1st row,<br>2nd column
  • etc.

Important The Table function represents an extension of the format templates table, tr and td. Therefore, the system object #content is also available in this function.

When other formatting is used (e.g. bold), the format templates are worked through one after the other and the contents are output with #content .

Here is an example: The format template with the abbreviation td (for table cells) contains the following content:

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

The format template with the abbreviation b (for bold) contains the following content:

*Bold highlighted: <b>$CMS_VALUE(#content)$</b>*

The text entered for a cell is:

A text row with text highlighted in <b>bold</b>.

The output now takes place in two stages:

First the format template td is opened and the #content replaced:

<td>A text row with text highlighted in <b>bold</b> .</td>

Now the area enclosed by the opening and closing b tag has the format template b applied to it and the #content is replaced:

<td>A text row with text highlighted in *bold: <b>bold</b>*.</td>

#content and $CMS_RENDER(...)$

A format template can be addressed by a $CMS_RENDER(...)$ instruction, however, the system object #content cannot be set by $CMS_RENDER(...)$.

Therefore, in this case #content is always null

ERROR: Expression delivers 'null'
inside of: Template 'renderTest' (id=771044)
inside of: $CMS_RENDER(template:"renderTest", content:"Test")$ - at 3, 1
inside of: Format Template 'renderTest' (id=771045)
inside of: $CMS_VALUE(#content)$ - at 1, 1

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.13 | Data privacy