Template Examples
Using variable paths that contain spaces in their names
Let’s assume a brick produces an output called @userPreferences
and you want to reference the favorite color
in a text template.
In the Page Editor Data Panel, the Output Data Tab might show:
Example Output Tab of the Data Panel showing data with names that include spaces.
To use the favorite color in a text template expression, you must use square brackets and quotation marks:
Text substitution using the replace filter
To replace all occurrences of a word or phrase, use the replace
filter. For example, to replace all occurrences of bricks
with brix
:
Chaining multiple filters in an expression
You can chain multiple filters using the |
pipe operator. For example:
Will produce the following text output:
Looping over elements of an array
You can use the for tag to loop over elements of an array. This is handy for creating bulleted lists in inputs that support Markdown, such as the Render Markdown brick
Last updated