Skip to main content

Comment style

Comment-style templates use HTML comments as delimiters: <!--# ... #-->. This makes them ideal for HTML templates that are edited in HTML editors, since the template markers are valid HTML comments and will not interfere with the editor.

Select render mode Comment 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.

<p>Workflow <!--# $workflow.id #--> has been updated by <!--# source.person_name #-->.</p>

Nested properties are supported:

<a href="<!--# source.account #-->/workflows/<!--# $workflow.id #-->">
<!--# $workflow.subject #-->
</a>

Values are automatically HTML-encoded when the template contains HTML. This prevents HTML injection. Rich text types (see Rich text rendering below) are not encoded, since they produce HTML output by design.

Conditionals

Use <!--BEGIN-IF# ... #--> and <!--END-IF--> to conditionally include content.

Existence check

By default (with !=), the block is included when the value is not empty and not null:

<!--BEGIN-IF# $workflow.release #!=-->
<tr>
<td>Release: <!--#$workflow.release.subject#--></td>
</tr>
<!--END-IF-->

or, equivalently:

<!--BEGIN-IF# $workflow.release #-->
<tr>
<td>Release: <!--#$workflow.release.subject#--></td>
</tr>
<!--END-IF-->

Equality check

Use == to compare against a specific value:

<!--BEGIN-IF#$workflow.status#==completed-->
<p>This workflow is completed.</p>
<!--END-IF-->

Inequality check

Use != with a value to check that the expression does not equal that value:

<!--BEGIN-IF#$workflow.status#!=completed-->
<p>This workflow is not yet completed.</p>
<!--END-IF-->

Nested conditionals

Conditionals can be nested:

<!--BEGIN-IF#$workflow.release#!=-->
<!--BEGIN-IF#$workflow.release.status#==active-->
<p>Active release: <!--#$workflow.release.subject#--></p>
<!--END-IF-->
<!--END-IF-->

Lists and loops

Lists repeat a section of the template for each element of an array. The items in the repeated section are accessed through the ITEM variable.

List variants

TagDescription
BEGIN-LISTIterates over all items
BEGIN-LIST-ALLIterates over all non-internal items (filters out items where internal is true)
BEGIN-LIST-FIRSTRenders only the first non-internal item
BEGIN-LIST-LASTRenders only the last non-internal item

The BEGIN-LIST-ALL, BEGIN-LIST-FIRST and BEGIN-LIST-LAST tags are especially useful for working with lists of Xurrent notes.

Basic list

<!--BEGIN-LIST-ALL#$workflow.notes#-->
<table class="notes">
<!--BEGIN-ITEM-->
<tr>
<td><!--#ITEM.person.name#-->: <!--#ITEM.text#--></td>
</tr>
<!--END-ITEM-->
</table>
<!--END-LIST-->

Content outside the <!--BEGIN-ITEM-->...<!--END-ITEM--> block but inside the list is rendered once as header (before the items) or footer (after the items). The header and footer are only rendered when the list has items.

<!--BEGIN-LIST-ALL#$workflow.notes#-->
<table class="notes">
<tr><th>Notes</th></tr>
<!--BEGIN-ITEM-->
<tr>
<td><!--#ITEM.person.name#-->: <!--#ITEM.text#--></td>
</tr>
<!--END-ITEM-->
</table>
<!--END-LIST-->

Nested lists and conditionals

Lists can contain conditionals, and conditionals can contain lists:

<!--BEGIN-LIST-ALL#$workflow.notes#-->
<!--BEGIN-ITEM-->
<tr>
<td>
<!--#ITEM.person.name#-->
<!--BEGIN-IF#ITEM.person.account.name#!=-->
<span class="account"><!--#ITEM.person.account.name#--></span>
<!--END-IF-->
</td>
</tr>
<!--END-ITEM-->
<!--END-LIST-->

Formatting

Values can be formatted by using the extended syntax: <!--#[expression,TYPE,format;parameter]#-->.

Date

Format a date value:

<!--#[$workflow.created_at,DATE,DD/MM/YYYY]#-->

DateTime

Format a date-time value with an optional timezone. The timezone defaults to Berlin if not specified.

<!--#[ITEM.created_at,DATETIME,DD.MM.YYYY HH:mm z;Paris]#-->

The timezone parameter (after ;) specifies the city name for the timezone (e.g. Paris, Berlin, New_York).

Number

Format a number with an optional locale. The locale defaults to en-gb if not specified.

<!--#[$total,NUMBER,0,0.00]#-->
<!--#[$total,NUMBER,0.00;de]#-->

Currency

Format a currency value with an optional locale:

<!--#[$price,CURRENCY,$0,0.00]#-->
<!--#[$price,CURRENCY,0,0.00 €;de]#-->

Rich text rendering

Rich text values can be converted to HTML using the following types:

TypeDescription
TEXTILEConverts Textile markup to HTML
XURRENTConverts Xurrent rich text to HTML
ITRPSame as XURRENT, for backward compatibility reasons
MARKDOWNConverts Markdown to HTML
<!--#[ITEM.text,TEXTILE]#-->
<!--#[ITEM.text,XURRENT]#-->
<!--#[ITEM.text,MARKDOWN]#-->

Rich text output is not HTML-encoded, since the conversion itself produces HTML.