System objects
Using system objects
System objects can be used to access information, data and objects within the templates. This is useful, for example, in the generation and creation of a preview. Such information can be, for example, the starting time of the generation, the ID of the section or the page or the language currently being generated.
System objects are always context-dependent. Several system objects are available in all contexts, others in a specific context only.
Expressions can be applied to system objects.
The return value of a system object is an object or a data type (cf. Data types).
In general system objects can be read-accessed only. However, there are several methods which can also modify system objects or can affect the system performance. These include, e.g. the suppression of generation of a page in a page template (#global.stopGenerate).
Using system objects
The following table gives an overview of the contexts in which a specific system object is available and what it can be used for:
System object | Availability | Purpose/intended uses |
---|---|---|
Within a table cell:
| - Determination of the column number of a cell | |
Within format templates | - Output of the content of a Dom Editor section | |
Within templates used in a content projection | - Decision whether the data record to be output is the first | |
Within templates used in a document group | - Determination of child nodes of a document group | |
Within templates used in a document group | Determination of an element (e.g. a page reference) from the document group during the generation of the document group | |
Within parameter specifications of definitions of FS_BUTTONin forms | Determination of content of and information about FS_BUTTON in a form and processing for example in scripts | |
Within a $CMS_FOR(...)$ instruction | - Decision whether the element to be output is the first | |
Within rule definitions of dynamic forms | Controlling the visibility of the design elements CMS_GROUP and CMS_LABEL in a form | |
In all templates | - Determination of preview-related, project-related, page-related | |
Within a section template which is used in the CMS_INPUT_CONTENTAREALIST input component | - Determination of which section is currently being output | |
Within
| Accessing values of input components | |
Within lists:
| - Determination of the selected list display type | |
Within a list entry:
| - Determination of the position of the current list element | |
in all templates | - Determination of the number of decimal places in case of divisions | |
In the functions:
| - Output of the menu name | |
Within table templates used in a data source based section | - Determination of the last editor | |
Within a section template which is used in the CMS_INPUT_CONTENTAREALIST input component | - Determination whether the rendered section is located in a CMS_INPUT_CONTENTAREALIST or not | |
In all templates | - Output of the time of the last project change at the time of generation | |
in the format templates for table rows and cells (tag "tr" and "td") and style templates | - Use of values of the style template of inline tables in the standard format templates for tables | |
Within tables:
| - Determination of the number of rows in a table | |
Within all templates | - Represents always the object which is evaluated within the template at the moment. For this reason, the object type can vary. | |
Within tables:
| - Determination of the number of a row in a table | |
Invocation of system objects
System objects can be invoked wherever method invocations can be used:
Each system object begins with the hash sign # and is extended by the respective name of the system object. Different methods can be invoked depending on the type of system object.
Syntax:
$CMS_VALUE(#NAME[.METHOD])$
E.g.:
$CMS_IF(#global.preview)$
Preview
$CMS_ELSE$
No preview
$CMS_END_IF$
If a preview is generated for the current page Preview is output - otherwise No preview.