Articles in this section

#unless helper

The #unless helper is the inverse argument of the #if block helper. The #unless block renders if the #unless expression returns a false value.

{{#unless field}} expr {{else}} expr {{/unless}}

Template

Context

Output

{{#unless contact.phone}}
  Phone number missing
{{else}}
  Contact phone number
{{contact.phone}}
{{/unless}} 
{
  "contact": {
    "phone": "310-555-1234",
    "street": "streetName",
    "address": "streetAddress"
  }
}
Contact phone number is:
310-555-1234
{
  "contact": {
    "street": "streetName",
    "address": "streetAddress"
  }
}
Phone number missing