Handlebars if
Handlebars if: renders its block only when the value counts as true.
Next
Runtime verified
Test scripts included
Renders its block only when the value counts as true.
Syntax
{{#if condition}}
…
{{/if}}
Returns string.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
condition |
any | Yes | Value to test. |
Example
Tested in a Marketing Cloud Next email on 2026-11-22:
{{#if true}}yes{{else}}no{{/if}}rendersyes, as documented.{{#if ""}}yes{{else}}no{{/if}}rendersno, as documented.{{#if false}}a{{else if true}}b{{else}}c{{/if}}rendersb, as documented.
Show Next test script
Marketing Cloud Next
Works as documented
Every tested call rendered the documented result. Tested 2026-11-22 by rendering in a Marketing Cloud Next email.