#if, #elseif, #else, #question


#if, #elseif and #else statements can be used in templates to define "if this, then that" type scenarios.

Data markers are used within these to pull information directly from the matter or a contact.

#if

Can be used to output a statement based on information saved to a data marker.

Example

Output

{{#if property.tenure = "Leasehold"}}

As this is a leasehold property...

{{#endif}}

If the data marker property.tenure has "leasehold" saved against it, the defined statement will be outputted.

If the data is anything other than "leasehold" the statement will be ignored.

#elseif

Can be used to add extra variables into the statement.

Example

Output

{{#if property.tenure = "Leasehold"}}

As this is a leasehold property...

{{#elseif property.tenure = "freehold"}}

You're buying a freehold property!

{{#endif}}

When used on a matter and the data marker property.tenure has "leasehold" saved against it, the first statement will be outputted.

If the data marker has "freehold" saved against it, the 2nd statement will be outputted.

If the data is anything other than "leasehold" or "freehold" the statements will be ignored.

#else

Can be used to define an output if no other conditions have been met.

Example

Output

{{#if property.tenure = "Leasehold"}}

As this is a leasehold property...

{{#elseif property.tenure = "freehold"}}

You're buying a freehold property!

{{#else}}

We don't have any information on the tenure of the property.

{{#endif}}

When used on a matter and the data marker property.tenure has "leasehold" saved against it, the first statement will be outputted.

If the data marker has "freehold" saved against it, the 2nd statement will be outputted.

If the data is anything other than "leasehold" or "freehold" the 3rd statement will be outputted.

Contains

If the data marker is collecting multiple choice type data, use the helpercontains to output custom content for each answer.

Example

Output

{{#if risk.assessment.risks contains "Flood"}}

There is a risk of flooding at this property, and we recommend that you consult Barry Smith & Co to understand the full risk potential.

{{#endif}}

{{#if risk.assessment.risks contains "Contaminated Land"}}

There is a risk of....

{{#endif}}

When used on a matter and the data marker risk.assessment contains "Flood" as an answer, the first statement will be outputted.

If the data marker contains "Contaminated Land" as an answer, the 2nd statement will be outputted.

If the data marker contains both "Flood" and "Contaminated Land" as an answer, both statements will be outputted.

If the data marker contains neither, the statements will be ignored.

Greater than / Less than Symbols

If the data marker is collecting numerical data i.e. a number or currency type, use < or > symbols to define custom statements based on the value of the field.

Example

Output

{{#if fees.legal > 1000}}

As a premier client, we will hold your hand every step of the way...

{{#elseif fees.legal >= 500}}

As a valued client, you'll be able to reach us anytime on 07...

{{#else}}

We aim to respond to all your questions inside of 24 hours...

{{#endif}}

When used on a matter and the data marker fees.legal contains a value more than 1,000, the first statement will be outputted.

If the data marker contains a value more than or equal to 500, the 2nd statement will be outputted.

If the data marker contains a value other than the above (in this case, less than 499), the 3rd statement will be outputted.

True/False Statements

You can use #if statements to output custom content if a value is known to be true.

Example

Output

{{#if referral.fee}}

We will pay a referral fee of £200 to....

{{#endif}}

When used on a matter and the data marker referral.fee contains a value, the defined statement will be outputted.

If the data marker contains no data, the statement will be ignored.

If the data marker type is of the yes/no variety, a "yes" response would output the statement and a "no" response would result in the statement being ignored.

#question

Use #question data helpers to ask a yes/no question to the user generating the template, without the use of data markers.

The response will affect the content within the template but will not be saved for future use.

This is a great way of quickly customising content using data that isn't necessarily required for future use.

Example

Output

{{#question $includeWill "Should we include an offer of a will?"}}

{{#if $includeWill}}

Did you also know that we can provide a will with your conveyancing. To order a will, simply complete this short online form here....

{{#endif}}

When used on a matter and the user indicates the answer to the question is "yes", the defined statement will be outputted.

If the user indicates the answer is "no", the statement will be ignored.

Question statements do not support the use of further data markers or data helpers within the defined content. If this is required, it's best to use a custom data marker of the Yes/No type with a corresponding #if statement to define the output.

<< Previous      Next >>
Powered by HelpDocs (opens in a new tab)