Start page / Template development / Template syntax / Instructions

Instructions (CMS tags)

Use CMS tags

In the context of programming languages, an instruction is an individual, formulated rule which is to be executed when the program is processed. Instructions are usually assignments, control instructions (such as jumps, loops, and conditional instructions), and procedure calls. In FirstSpirit, special tags are used for this purpose, which begin with a leading "$CMS_" and end with ")$". Anything inside the brackets in a $CMS_...(...)$ tag is always an expression.

$CMS_...(...)$

These instructions can be used for a wide range of outputs in all areas of the Template Store.

For example, instructions can be used to:

  • Output the value of a variable, such as the content of an input component, to a specific location in the template ($CMS_VALUE(...)$ )
  • Resolve a reference to the Media Store of the project to a path which is output within the HTML template set, in the HTML area of a template, in an image tag ($CMS_REF(..)$)
  • Generate various outputs, depending on a condition, such as the width of an image ($CMS_IF(...)$)
  • Format the source text generated by removing unnecessary empty lines and white spaces (carriage return, linefeed, tab, and space) ($CMS_TRIM(...)$)
  • These are just some of the many possible examples.

Important $CMS_...(...)$ expressions are not resolved inside the <CMS_HEADER> tags of a template.
This property is one of the main sources of errors in template development.

Automatic code completion can be used on template set tabs for tags beginning with $.

Nesting of instructions

Instructions can be nested to any depth.

$CMS_SET(set_myVar)$This is $CMS_VALUE(set_ort)$ the text$CMS_END_SET$
<pre>
$CMS_SET(set_ort,"above")$$CMS_VALUE(set_myVar)$
TEXT
$CMS_SET(set_ort,"below")$$CMS_VALUE(set_myVar)$
</pre>

The example returns the following output:

This is above the text
TEXT
This is below the text

Creation of blocks

In addition, the creation of blocks is being introduced for complex tags according to the following schema:

$CMS_...(...)$
//any text, including with further CMS tags
$CMS_END_...$

Passing parameters

Parameters can be passed using instructions.

The following applies here:

  • The identifier of a parameter is separated from the value by a colon.
  • Multiple parameters are separated using commas:

...,IDENTIFIER_1:"VALUE_1",IDENTIFIER_2:OBJECT_2, ...,IDENTIFIER_N:"VALUE_N"

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