Templating Helper functions
- Default
- Explode
- Use Query
- Filter
Use this helper when you need a fallback value in case a variable from your data is unavailable.
{{ default some_variable some_string }}
produces some_variable ?? some_string
Explode is used in the field
prop of layout_list
when you want to iterate over an array of non-objects.
It maps each item into an object with a key that you can access in the items
of the layout_list
.
use_query
is used when you want to use the search query in a component.
The filter
helper can be used in field
or appTilesField
to filter through an array of data.
It takes 4 parameters: {{ filter nameOfArrayInData nameOfFilterField equalityValue }}
.
The filter helper will pull in the array from nameOfArrayInData
,
and then compare it's nameOfFilterField
field to equalityValue
by doing nameOfFilterField == equalityValue
.