Julien
Julien

Reputation: 131

Trouble getting Mandrill Handlebars comparison expression to work

Template:

<h1>{{TotalEvals}}</h1><span style="color:#A9A9A9"><span style="font-size:19px"> Evaluation{{#if TotalEvals > 1}}s{{/if}}</span></span>      

Output:

12

Evaluation{{#if TotalEvals > 1}}s{{/if}}

This is almost identical to an example they have on the Mandrill website here. Any help on why the if statement isn't working would be greatly appreciated.

Upvotes: 2

Views: 1614

Answers (1)

Julien
Julien

Reputation: 131

Turns out that the conditional element of the if statement needs to be surrounded by back-ticks (`) like the following:

<h1>{{TotalEvals}}</h1><span style="color:#A9A9A9"><span style="font-size:19px"> Evaluation{{#if `TotalEvals > 1`}}s{{/if}}</span></span>

Upvotes: 8

Related Questions