Skip to content

Conditionals Guide

Conditionals let you include or exclude paragraphs based on the matter’s details. For example, you might include a swimming pool compliance paragraph only when the property has a pool.

{%p if condition %}
Text that appears when condition is true
{%p endif %}

Scenario: Sir Lancelot is buying an apartment in Camelot Towers. We need to include strata-specific warnings.

{%p if property.is_strata %}
As this is a strata-titled property, please be aware that you will be bound
by the Owners Corporation by-laws. We recommend reviewing the strata report
carefully, paying particular attention to any special levies or ongoing
disputes.
{%p endif %}

Result when property.is_strata is YES: The paragraph appears. Result when property.is_strata is NO: The paragraph is completely removed.

Scenario: Michael Scott is selling his condo, which has a shared pool.

{%p if property.swimming_pool %}
We remind you that a valid Certificate of Pool Compliance must be attached
to the contract. Please arrange for an inspection if you haven't already
done so. "No running!" - the sign says, and we agree with its wisdom.
{%p endif %}

Scenario: We’re acting for the executors in the Estate of the Late King Arthur.

{%p if sale.is_estate %}
We note that settlement cannot occur until a grant of probate has been
issued. The completion date is therefore the later of:
- 42 days from the contract date; or
- 14 days after we notify the buyer's solicitor that you have formally
become the legal owner of the property.
{%p endif %}

Show one text or another (never both):

{%p if sale.is_auction %}
The property will be sold at auction on {{ sale.auction_date | date }}.
The reserve price is {{ sale.reserve | currency }}.
{%p endif %}
{%p if sale.not_auction %}
Once a suitable buyer has been found, their solicitor's details will be
added to the contract.
{%p endif %}

Several independent conditions, any combination can be true:

{%p if property.is_strata %}
Strata information paragraph...
{%p endif %}
{%p if property.swimming_pool %}
Pool compliance paragraph...
{%p endif %}
{%p if property.has_illegal_works %}
Unapproved works special condition...
{%p endif %}
{%p if transaction.deposit_release %}
Early deposit release clause...
{%p endif %}

Each paragraph appears independently based on its condition.

Use for costs agreements or engagement letters where services are selected:

We will provide the following services:
{%p if services.contract_preparation %}
• Preparation of the Contract for Sale
{%p endif %}
{%p if services.title_search %}
• Title search and examination
{%p endif %}
{%p if services.strata_search %}
• Strata records search and analysis
{%p endif %}
{%p if services.settlement_attendance %}
• Attendance at settlement
{%p endif %}

Here’s a complete letter section showing multiple conditionals working together:

RE: {{ property.re_line }}
We refer to your instructions regarding the sale of the above property.
Contract Terms
The contract provides for a completion date 42 days from the date of
exchange, which is the standard period in New South Wales.
{%p if transaction.simultaneous_purchase %}
We understand you wish to coordinate this sale with your purchase of
another property. It is critical that you do not sign a purchase contract
without consulting us first. We need to align the settlement dates to
avoid you being caught without funds.
{%p endif %}
{%p if transaction.vendor_renting_back %}
As requested, we have included a special condition allowing you to remain
in the property for up to {{ transaction.rent_back_weeks }} weeks after
settlement at {{ transaction.rent_back_amount | currency }} per week.
Be aware this may deter some buyers.
{%p endif %}
{%p if transaction.christmas_settlement %}
Please note: if the 42-day settlement period falls between 22 December
and 21 January, the settlement date automatically moves to 23 January.
{%p endif %}
{%p if sale.is_estate %}
Settlement cannot occur until probate is granted. The completion date will
be the later of 42 days from exchange, or 14 days after probate is granted.
{%p endif %}
Property Matters
{%p if property.is_strata %}
Strata Information
You have advised us that you are not aware of any illegal building works
by the Owners Corporation. If the strata search reveals any pending
special levies, you may be responsible for these.
{%p endif %}
{%p if property.swimming_pool %}
Swimming Pool
A valid Certificate of Pool Compliance must be attached to the contract.
Please ensure you have arranged for the necessary inspection.
{%p endif %}
{%p if property.has_illegal_works %}
Unapproved Building Works
We have included a special condition regarding the {{ property.illegal_works }}.
This protects you from claims by the buyer about these works.
{%p endif %}
{%p if sale.not_auction %}
Next Steps
Once a buyer is found, please provide us with their solicitor's details so
we can send the contract for their review.
{%p endif %}
{%p if sale.is_auction %}
Auction
The property will be sold at auction. Please ensure you are available on
the auction date or have arranged for someone to attend on your behalf.
{%p endif %}

In your matter.json, define boolean fields for conditionals:

{
"blocks": {
"transaction": {
"label": "Transaction Details",
"fields": {
"simultaneous_purchase": {
"type": "boolean",
"label": "Coordinating with another purchase?",
"required": false,
"help": "Check if the vendor is also buying another property"
},
"deposit_release": {
"type": "boolean",
"label": "Early deposit release requested?",
"required": false,
"help": "Check if the vendor wants access to the deposit before settlement"
},
"christmas_settlement": {
"type": "boolean",
"label": "Settlement may fall over Christmas?",
"required": false,
"help": "Check if the 42-day period might include Dec 22 - Jan 21"
}
}
},
"property": {
"label": "Property Details",
"fields": {
"is_strata": {
"type": "boolean",
"label": "Strata property?",
"required": false,
"help": "Check if this is an apartment, unit, or townhouse in a strata scheme"
},
"swimming_pool": {
"type": "boolean",
"label": "Swimming pool on property?",
"required": false
},
"has_illegal_works": {
"type": "boolean",
"label": "Unapproved building works?",
"required": false
},
"illegal_works": {
"type": "text",
"label": "Description of unapproved works",
"required": false,
"help": "e.g., 'Enclosed rear verandah without council approval'"
}
}
}
}
}

Cause: Unbalanced {%p if %} and {%p endif %} tags.

Fix: Count your tags. Every {%p if %} needs exactly one {%p endif %}.

{%p if property.is_strata %} ← Opening tag #1
Strata content...
{%p endif %} ← Closing tag #1 ✓
{%p if property.swimming_pool %} ← Opening tag #2
Pool content...
← Missing closing tag! ✗

Cause: The field isn’t set up as a boolean, or it has a default value of “true”.

Fix:

  1. Check the field type is "type": "boolean" in matter.json
  2. Ensure the default isn’t accidentally true
  3. Make sure the user actually answered the question

Cause: The field name in the template doesn’t match matter.json.

Fix: Check for typos. property.is_strata is different from property.isStrata.

Cause: {%p endif %} is in the wrong place.

Fix: Make sure your {%p endif %} is immediately after the conditional content:

{%p if condition %}
This text should be conditional.
{%p endif %}
This text should always appear. ← Should NOT be inside the if block

1. Keep conditions simple

One condition per {%p if %} block. Don’t try to combine complex logic.

2. Use descriptive field names

property.is_strata is clearer than strata or prop_strata_yn.

3. Use inverse fields

For “if NOT” conditions, use sale.not_auction instead of {% if not sale.is_auction %}. Inverses are computed automatically.

4. Test both states

Generate documents with the condition both true AND false to verify.


Certum Draft automatically creates inverse boolean fields at render time. You don’t need to define these manually.

When you set a primary field in the matter form:

Primary Field (You Set)Inverse Field (Auto-Created)
sale.is_auction = YESsale.not_auction = NO
sale.is_auction = NOsale.not_auction = YES
property.is_strata = YESproperty.not_strata = NO
property.has_pool = YESproperty.no_pool = NO
Primary PatternInverse Pattern
*.is_**.not_*
*.has_**.no_*
*.expired*.not_expired
*.by_agent*.not_by_agent

Cleaner templates:

{%p if sale.not_auction %} ← Easy to read
Private treaty terms...
{%p endif %}

Instead of:

{%p if not sale.is_auction %} ← Harder to parse
Private treaty terms...
{%p endif %}

{%p if field_name %}
Conditional paragraph
{%p endif %}
FieldWhat it controls
property.is_strataStrata/unit title warnings
property.swimming_poolPool compliance requirements
property.has_illegal_worksUnapproved works disclosure
sale.is_auctionAuction sale terms
sale.is_estateDeceased estate provisions
transaction.simultaneous_purchaseCoordinated sale/purchase
transaction.deposit_releaseEarly deposit access
transaction.vendor_renting_backPost-settlement rental