Template variables

Templates use merge fields in double curly braces. Pass values in the variables object of your render request.

Scalars

html
<h1>{{title}}</h1>
<p>Hello {{user.name}}</p>
json
{
  "title": "Monthly Report",
  "user": { "name": "Jane Doe" }
}

Loops

html
{{for users}}
<tr>
  <td>{{users.name}}</td>
  <td>{{users.email}}</td>
</tr>
{{endfor}}

Inside a loop, the collection name refers to the current item (not the whole array).

Conditionals

html
{{if user.active}}
<p>Welcome back, {{user.name}}!</p>
{{else}}
<p>Please activate your account.</p>
{{endif}}

A value is truthy when it is present and not false, empty string, zero, or an empty array.