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:
- check and evaluate the editor's inputs (see define function).
- render texts as a picture or on an already existing background picture (see Font function).
- output filtered data from the Content Store (see contentSelect function).
- evaluate structures of the Site Store for the navigation (see Navigation function).
This is possible in particular for menu groups too (see MenuGroup function)
or page groups (see PageGroup function).
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]))$