The t, number, currency, datetime, and relativetime helpers are language and time zone aware, using the template rendering context to determine formatting behavior.
All formatting helpers use the language property from the resolve input:
The language is passed to the t helper (supported by i18next) to determine to which language the supplied localization key needs to be translated. A deeper explanation on how to localize strings in templates can be found in on the Localizations in Templates page.
This language is also passed internally to the corresponding Intl.* formatter and determines:
Number formatting (decimal separators, grouping) via number
Currency formatting (symbol placement, spacing) via currency
Date and time formatting (month names, ordering, 12/24h clock) via datetime
Relative time phrasing (e.g., “1 day ago”) via relativetime
If no language is provided, "EN" is used.
The datetime helper additionally respects the timeZone property from the resolve input.
If provided, it is passed to Intl.DateTimeFormat.
If omitted, the time zone "UTC" is used.
In this example, sum is used as a subexpression and is evaluated first inside round brackets (...), after which its result is passed as an argument to le.
This can also be used to construct if cases with combined and ,or and not
Divides the first argument by the rest sequentially
Input:{{divide 20 2 2}}Output: 5
mod
Returns remainder of a division (arg1 % arg2)
Input:{{mod 10 3}}Output: 1
floor
Rounds a number down
Input:{{floor 4.8}}Output: 4
ceil
Rounds a number up
Input:{{ceil 4.2}}Output: 5
round
Rounds to the nearest integer
Input:{{round 4.5}}Output: 5
Array helpers
Name
Behaviour
Example
length
Returns the length of an array
includes
Checks whether an array contains a value
join
Joins array elements using a separator
String helpers
Name
Behaviour
Example
includes
Checks whether a string contains a substring
length
Returns the length of a string
join
Joins multiple arguments using a separator (default ", ")
Object helpers
Name
Behaviour
Example
toJsonString
Serializes data into a JSON string. Because JSON may contain special characters, the way you render the output depends on the context.
If used in plain text or in HTML within a <script> tag, use triple braces ({{{ }}}) to prevent HTML escaping. Any mention of </script will also be replaced by <\/script to prevent the JSON from accidentally breaking out of the <script> tag.
Double braces ({{ }}) can be used if you want to render the JSON as text in HTML.
{{#if (or (and @inputs.has_permission @inputs.is_logged_in) (not @inputs.authentication))}}
Show me the page
{{else}}
Please authenticate first
{{/if}}