def
Returns a given default value for a variable, in case the variable is not defined anywhere.
@{ variable | def (value) }
Parameters
- value
- The default value to be returned in case
variable
is not defined.
Example
The following example demonstrates a standard use case for providing a default value. Let's assume a pagelist is sorted by the query string paramter sort
. In case there is no query string parameters defined, the list is sorted by date desc
(in other words: recent first).
<@ newPagelist {
sort: @{ ?sort | def ('date desc') }
} @>