Skip to content

Syntax basics

Before the individual helpers, here are the rules that apply to every template.

Everything dynamic goes inside double curly braces. Anything outside them is output exactly as written:

Dear {{matter.primaryclient.forename}},
  • Every {{ must be paired with a matching }}. A single stray curly brace is an error.
  • Marker and helper names are not case-sensitive{{Matter.Name}} and {{matter.name}} behave the same.
  • Block helpers (like #if and #foreach) need a matching closing tag (#endif, #endforeach).

A double-hash inside mustaches is a comment. It is visible in the template builder but never output, and it leaves no extra spaces behind:

{{## This section only applies to leasehold properties}}

Comments can span multiple lines and contain any characters — markers, symbols, and quotes inside a comment are ignored:

{{## reviewed by ABdo not remove the #if below}}

A code block lets you write several statements in one set of mustaches, separated by semicolons ;, instead of repeating {{ }} around each one. It keeps runs of logic compact and readable.

{{@@
#var $five = 5;
#var $ten = 2 * $five;
#var $twenty = 2 * $ten;
$twenty
}}

The block above outputs 20.00. Each statement between the semicolons is treated exactly as if you had written it in its own {{ }}.

  • Separate every statement with a semicolon ;.
  • Whitespace and line breaks between statements are ignored, so you can indent for readability.
  • A bare variable on its own line (like $twenty above) outputs its value.

Block helpers such as #if / #else / #endif work inside a code block — end each line with a semicolon:

{{@@
#if number > 10;
#calc number - 10;
#else;
#calc number + 10;
#endif;
}}

You can use several code blocks in one template and interleave them with normal text or HTML. Variables set in an earlier block are still available later:

{{@@
#var $five = 5;
#var $ten = 2 * $five;
}}<p>First result — {{$ten}}</p>
{{@@
#var $twenty = 2 * $ten;
}}<p>Second result — {{$twenty}}</p>

← Contents · Data markers →