Start page / Template development / Template syntax / System objects

System objectsAvailable from FirstSpirit Version 4.0

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

#card

Within section and link templates which are referenced by an FS_CATALOG input component

- Access to the section / link of an FS_CATALOG input component (“Card”)
- Determination of the UUID of the “Card”

#cell

Within a table cell:

  • Format template with the abbreviation td
  • CELL parameter in the function Table

- Determination of the column number of a cell
- Determination of the row number of a cell
- Output of attribute values of a column
- Alignment of the text of a cell
- Merging of several cells
etc.

#content

Within format templates

- Output of the content of a Dom Editor section
- Output of a table cell
- Definition of a Table function

#cs

Within templates used in a content projection

- Decision whether the dataset to be output is the first
- Decision whether the dataset to be output is the last
- Determination which dataset is currently being output

#docGroup

Within templates used in a document group

- Determination of child nodes of a document group
- Determination of the depth of a node within the document group
- Determination whether a node is of type "Menu level" or "Page reference"

#docNode

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

#field

Within parameter specifications of definitions of FS_BUTTON in forms

Determination of content of and information about FS_BUTTON in a form and processing for example in scripts

#for

Within a $CMS_FOR(...)$ instruction

- Decision whether the element to be output is the first
- Decision whether the element to be output is the last
- Determination which element is currently being output

#form

Within rule definitions of dynamic forms

Controlling the visibility of the design elements CMS_GROUP and CMS_LABEL in a form

#fs_catalog

Within a template used within the FS_CATALOG input component

- Determination whether the rendered element is located in an FS_CATALOG input component or not
- number of elements contained in an FS_CATALOG input component

#global

In all templates

- Determination of preview-related, project-related, page-related
information.
- Determination of meta information
- Determination of information on multiple pages

#index

Within a (section / link ) template which is used in a FS_CATALOG input component

- Determination of which section / link is currently being output

#item

Within

Accessing values of input components

#list

Within lists:

  • Format template with the abbreviation ul
  • Format template with the abbreviation li

- Determination of the selected list display type
- Determination of the number of list elements
- Determination of the starting point of the list
- Determination of the last list point

#listitem

Within a list entry:

  • Format template with the abbreviation li

- Determination of the position of the current list element
- Determination of the lettering of the current list element

#mathContext

in all templates

- Determination of the number of decimal places in case of divisions
- Determination of the rounding mode

#meta

Within snippets

Output of information from metadata

#nav

In the functions:

- Output of the menu name
- Determination of the URL
- Output of the comment field
etc.

#row

Within table templates used in a data source based section

- Determination of the last editor
- Determination of the change date
- Output of attributes (contents of columns)

#startdate

In all templates

- Output of the time of the last project change at the time of generation

#style

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

#table

Within tables:

  • Format templates with the abbreviations table, tr and td
  • in the function Table

- Determination of the number of rows in a table
- Determination of the number of columns in a table
- Number of the last row in a table
- Number of the last column in a table
- Determination of the table format template

#this

Within all templates

- Represents always the object which is evaluated within the template at the moment. For this reason, the object type can vary.

#tr

Within tables:

  • Format templates with the abbreviation tr
  • in the function Table

- Determination of the number of a row in a table
- Determination whether the current row is the first row of the table
- Determination whether the current row is the last row of the 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.

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