Fields
Template
The template supports several tags and filters. Rendering of data or using filters is done through{{ }} and {% %} tags.
The following tags are supported:
if
Anif statement used for decision-making, if a certain condition is met output can be rendered.
More complex conditions can be created with and and or.
for
Used to loop over a set of items.The following filters are supported:
abs
Theabs filter returns the absolute value.
batch
Filter items from a set into batches. Arguments:size: How many items should each batch containfill: Missing items will show this textpreserve_keys: Whether to preserve keys or not (defaults to true)
capitalize
Capitalize the first value.default
Return the supplied default value if the variable is empty or not defined.escape (e)
Warning: Using this function doesn’t guarantee the input is safe in all contexts. Ensure untrusted input isn’t used in sensitive contexts.
Escape or the shorthand e can be used to escape text based on a supplied strategy.
first
Returns the first item in a set.format
Format text based on with placeholders.join
Joins a list of items into a single string based on first argument, the second argument is used for the last item.keys
Returns the keys of a set of items.last
Returns the last item in a set.length
Returns the number of items in a set.lower
Convert text to lowercase.nl2br
Change new lines to break rule tags<br />
number_format
Format a number based on the arguments:decimal: The number of decimal points to displaydecimal_point: The character(s) to use for the decimal pointthousand_sep: The character(s) to use for the thousands separator
replace
Replace text value based on a set of search and replace criteria.reverse
Reverse the order of a set of items.round
Round a number to the desired amount of decimals. Arguments:precision: Precision to round to. 0 for whole numbers.method:common(default) round up or down.ceilalways round up andflooralways round down.
striptags
Strip tags SGML/XML and replace adjacent whitespace characters by one space. As an argument tags can be supplied that should not be stripped from the data.title
Capitalize every word in the supplied text.trim
Remove whitespace data.character_mask: The characters to stripside: The default is to strip from the left and the right (both) sides, but left and right will strip from either the left side or right side only
upper
Convert text to uppercase the text.url_encode
Convert characters in a text to their url percent equivalent (e.g. becomes %20)