Template syntax
Clausery templates are ordinary .docx files with tags. Formatting is yours: whatever style a tag has in Word, the answer inherits.
Open Clausery Browse free templates
Tags#
| Write in Word | Meaning |
|---|---|
{client_name} | Replaced with the answer. Names use letters, digits and underscores. |
{#has_spouse} … {/has_spouse} | Conditional section: kept when the answer is yes (or truthy), removed otherwise. |
{^has_spouse} … {/has_spouse} | Inverted section: kept when the answer is no. |
{#children}{name}, born {dob}{/children} | Repeating group: the content repeats once per item, and tags inside refer to that item. |
{_today} | Today's date in the workspace date format. |
{_firm_name} | The firm name from Settings. |
Conditional sections#
A section tag can wrap a few words, a sentence, a whole paragraph or several paragraphs. When the opening and closing tags are each alone in their own paragraph, the paragraphs themselves are removed, leaving no empty lines:
{#has_guarantor}
GUARANTEE
The Guarantor, {guarantor_name}, guarantees the obligations of the Tenant.
{/has_guarantor}
Questions that appear only inside a section are automatically shown only when that section applies. A section can also be driven by a calculation instead of a yes/no question: in the designer, change its type to Computed and give it an expression such as amount > 10000.
Repeating groups#
Use a repeating group for anything that comes in an unknown number: parties, attorneys, beneficiaries, schedule items.
The following attorneys will work on the matter:
{#attorneys}
• {name}, {role} — {rate} per hour
{/attorneys}
Inside a group these extra tags are available: {_index} (1, 2, 3…), {_count}, and the conditions {#_first} and {#_last}. The last one is useful for separators:
{#parties}{name}{^_last}, {/_last}{/parties}
Table rows
Put the opening tag in the first cell of a row and the closing tag in the last cell of the same row; the whole row repeats:
| Description | Quantity | Amount |
|---|---|---|
{#items}{description} | {qty} | {amount}{/items} |
Line breaks#
Long-text answers keep their line breaks, so an address typed on three lines comes out on three lines.
Headers, footers and footnotes#
Tags work anywhere in the document, including headers, footers and footnotes.
Naming tips#
Clausery guesses the question type from the tag name. You can change it afterwards, but good names save work:
*_date,signed_on,deadline→ date*_amount,fee,salary,rate,total→ money*_years,*_days,count,quantity,percent→ number*_email,*_phone→ email, phoneaddress,description,notes→ long texthas_*,is_*,include_*as section names → yes/no condition- Plural section names with tags inside (
attorneys,parties) → repeating group - Shared prefixes (
party_a_*,client_*) → grouped into a section of the questionnaire
What is not supported#
- Nested repeating groups (a list inside a list). Nested conditions inside a group are fine.
- Images or raw XML inserted from answers.
- Legacy .doc files: save as .docx first.