isSet(...)
The isSet(...) function can be used to check whether an object is available in the current context. This is useful if an object is context-dependent, e.g. the system object #cs .
The syntax of the isSet(...) function is as follows:
$CMS_IF(isSet(OBJECT))$
VALUE
$CMS_END_IF$
The isSet(...) function can only be applied to an object and not to an expression. |
Examples
Check whether the system object #cs is available:
$CMS_IF(isSet(#cs))$
The system object #cs is available.
$CMS_ELSE$
The system object #cs is not available.
$CMS_END_IF$
Check whether the variable sizeConstant is available in the context:
$CMS_IF(isSet(sizeConstant))$
The Variable sizeConstant is available in the context.
$CMS_END_IF$
isSet(...) and the system object #link
In addition to the check whether an object exists in the context, the isSet(...) invocation can be used on a #link system object to check whether a specific field has been set or not.
The invocation is as follows:
$CMS_IF(#link.isSet("FIELDNAME"))$
VALUE
$CMS_END_IF$
The invocation expects the name of the field to be checked as the parameter.
The possible fields of a link are given in the list in the system object #link:
Examples
Check whether the text field has been set:
$CMS_IF(#link.isSet("text"))$
A value has been set for the "text" field
$CMS_END_IF$
Check whether the target field has been set:
$CMS_IF(#link.isSet("target"))$
A value has been set for the "target" field
$CMS_END_IF$