Filters
A list of basic Twig filters can be found in the Twig documentation.
The following filters are custom made for Frontender:
Pluralise
A simple extension that allows you to pluralise a given string.
'string'|pluralize
output: strings
Singularise
A simple extension that allows you to singularise a given string.
'strings'|singularize
output: string
Translate
Additional information about localisation can be found on the Templates page. Translate a string into a different locale with any of the following translation filters:
|i18n|t|translate
{{ {'en-GB': 'Red', 'fr-FR': "Rouge"}|i18n }}
{{ {'en-GB': 'Red', 'fr-FR': "Rouge"}|t }}
{{ {'en-GB': 'Red', 'fr-FR': "Rouge"}|translate }}
All result in the following output, assuming the English scope is active:
output: Red
Markdown
Display content while respecting it's original markdown syntax.
|markdown|md
{
"example": {
"value": "####Heading level 4",
"label": {
"en-GB": "Markdown example"
},
"control": "core/markdown"
}
}
{{ example|md }}
or
{{ example|markdown }}
Output:
<h4>Heading level 4</h4>