Start page
Start page

Start page / Template development / Template syntax / Functions

Functions

Header functions

Functions are defined within the <CMS_HEADER> tags. It is only permissible to enter valid XML within these tags. Alternatively, functions can also be generated and inserted by a BeanShell script.

Each CMS function is enclosed by a <CMS_FUNCTION> tag in which the "name" and "resultname" attributes must be set. The defined value for "name" is the function identifier with which the function can be invoked, the identifier of the return variable which saves the result of the function is defined in "resultname". Functions are executed once only on generation of a page. Only functions known to the server can be used in the Template Store. They are explained in the following chapters.

Tasks of functions

Using functions can introduce a certain dynamic to HTML pages. As functions are defined by the template developer within the templates the editors themselves do not require any HTML knowledge to adjust the design of a page. The editors make their selection, in the GUI elements available which are then evaluated by functions. The display is adjusted according to the results of the functions.

In general, functions in FirstSpirit have the following tasks:

Invoking functions

Functions can be invoked wherever method invocations can be used. Unlike methods, however, functions do not relate to an object:

Each function has a function identifier via which they can be invoked. Depending on the type of function, one or several parameters can be passed. Apart from the passed parameters, functions have local variables which are only valid within the function. Several functions return the result of the execution as a returned value.

Syntax:

$CMS_VALUE(methodName([Argument]))$

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2013-12-09