The template expression language is a small subset of JavaScript, and uses JavaScript syntax and precedence rules. You can use JavaScript operators to write an expression like this:
@@(firstName+lastName)@@
The following features and operators are supported:
true
or false
)The following data types are used: Boolean, IEEE 64-bit floating point, string, and object. Dreamweaver templates do not support the use of JavaScript "null" or "undefined" types. Nor do they allow scalar types to be implicitly converted into an object; thus, the expression "abc".length
would trigger an error, instead of yielding the value 3.
The only objects available are those defined by the expression object model. The following variables are defined:
Contains the document-level template data with a field for each parameter in the template.
Only defined for expressions which appear inside a repeating region. Provides built-in information about the region:
_index The numerical index (from 0) of the current entry
_numRows The total number of entries in this repeating region
_isFirst True if the current entry is the first entry in its repeating region
_isLast True if the current entry is the last entry in its repeating region
_prevRecord The _repeat
object for the previous entry. It is an error to access this property for the first entry in the region.
_nextRecord The _repeat
object for the next entry. It is an error to access this property for the last entry in the region.
_parent In a nested repeated region, this gives the _repeat object for the enclosing (outer) repeated region. It is an error to access this property outside of a nested repeated region.
During expression evaluation, all fields of the _document object and _repeat object are implicitly available. For example, you can enter title
instead of _document.title
to access the documents title parameter.
In cases where there is a field conflict, fields of the _repeat object take precedence over fields of the _document object. Therefore, you shouldnt need to explicitly reference _document or _repeat except that _document might be needed inside a repeat region to reference document parameters that are hidden by repeated region parameters.
When nested repeated regions are used, only fields of the innermost repeated regions are available implicitly. Outer regions must be explicitly referenced using _parent.