Start page
Start page

Start page / Template development / Template syntax / Instructions

Instructions (CMS tags)

Using CMS tags

In the context of programming languages an instruction is understood to be a formulated individual regulation to be executed while working through the program. Instructions are usually allocations, control instructions (such as jumps/skips, loops and conditional instructions) and procedure invocations. Within the FIRSTspirit editing environment special tags are used for this purpose which begin with an introductory "$CMS_" and end with a ")$". Everything within the brackets in a $CMS_...(...)$ tag is basically an expression!

$CMS_...(...)$

These instructions can be used for all kinds of different outputs in all areas of the Template Store.

For example, instructions can be used:

  • to output the value of a variable, for example the content of an input component, in a specific position of the template ($CMS_VALUE(...)$ ).
  • to resolve a reference in the project's Media Store to a path, which is output in an image tag in the HTML area of a template within the HTML output channel. ($CMS_REF(...)$ )
  • to generate, depending on a condition, for example the width of a picture, different outputs ($CMS_IF(...)$).
  • to format the generated source text by removing unnecessary empty rows and whitespaces (carriage return, linefeed, tab and space) from it ($CMS_TRIM(...)$).
  • and many more.

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

Nesting of instructions

Instructions can be nested as deep as required .

$CMS_SET(set_myVar)$This locates $CMS_VALUE(set_ort)$ the text$CMS_END_SET$
<pre>
$CMS_SET(set_ort,"über")$$CMS_VALUE(set_myVar)$
TEXT
$CMS_SET(set_ort,"unter")$$CMS_VALUE(set_myVar)$
</pre>

The example returns the following output:

This is above the text
TEXT
This is below the text

Formation of blocks

In addition, in more complex tags the Formation of blocks is introduced according to the following schema:

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

Passing parameters

Instructions can be used for passing parameters.

The following rules apply:

  • The identifier of a parameter must be separated from the value by a colon
  • If more than one parameter is used they must be passed separated by a comma:

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

© 2005 - 2014 e-Spirit AG | All rights reserved. | Last change: 2013-08-06