Skip to main content

Curly style

Curly-style templates use double curly braces as delimiters: {{...}}. The syntax is more concise than Comment style, but cannot be combined with client-side libraries that use the same markup (e.g. Angular).

Select render mode Curly style to use only this style, or Comment, Curly, ASP to combine it with other styles.

Value replacement

Use {{expression}} to output the value of an expression.

{{$request.subject}}

Nested properties are supported:

{{$request.requested_by.name}}

HTML encoding

Values are automatically HTML-encoded when the template contains HTML. To skip encoding and output raw HTML, prefix the expression with #:

{{#$request.html_content}}

Conditionals

Use {{?expression}}...{{?}} to conditionally include content. The expression is evaluated as JavaScript — the block is included when the result is truthy.

Truthiness check

{{?$request.notes}}
This request has notes.
{{?}}

Comparison operators

Since the expression is evaluated as JavaScript, you can use any comparison operator:

{{?$request.template.id==1234}}
This is template 1234.
{{?}}
{{?$request.status!="completed"}}
This request is not yet completed.
{{?}}

Nested conditionals

{{?$request.release}}
{{?$request.release.status=="active"}}
Active release: {{$request.release.subject}}
{{?}}
{{?}}

Lists and loops

Use {{@expression}}...{{@}} to iterate over an array.

Basic list

Inside the loop, define an item block with {{*variableName}}...{{*}}. The variable name can be any identifier and is used to access the current item's properties.

{{@$request.notes}}
Header
{{*note}}
{{note.person.name}}: {{note.text}}
{{*}}
Footer
{{@}}

Content outside the {{*...}}...{{*}} block but inside the loop is rendered once as header (before the items) or footer (after the items).

If no variable name is specified, the default ITEM is used:

{{@$request.notes}}
{{*}}
{{ITEM.text}}
{{*}}
{{@}}

Item filtering

Add a condition after the variable name (separated by a comma) to filter items:

{{@$request.notes}}
{{*note,!note.internal}}
{{note.text}}
{{*}}
{{@}}

Only items for which the condition is truthy are included.

First and last item

Use .first() or .last() on the array expression to render only the first or last element:

{{@$request.notes.first()}}
{{*note}}
First note: {{note.text}}
{{*}}
{{@}}
{{@$request.notes.last()}}
{{*note}}
Last note: {{note.text}}
{{*}}
{{@}}

Formatting functions

In curly-style templates, you can call the same text formatting functions that are available in scripts. These are called directly in the expression:

formatDate

{{formatDate($request.created_at,'DD/MM/YYYY')}}

formatDateTime

Format a date-time value with an optional timezone (defaults to Berlin):

{{formatDateTime($request.created_at,'DD/MM/YYYY HH:mm z','Paris')}}

formatNumber

Format a number with an optional locale (defaults to en-gb):

{{formatNumber($total,'0,0.00')}}
{{formatNumber($total,'0.00','de')}}