This helper creates an all-or-nothing argument. It prints the first expression if the argument is true, and the {{else}} expression if the argument is false.
{{#or field field}} expr {{else}} expr {{/or}}
|
Template |
Context |
Output |
|---|---|---|
{{#or item1 item2}}
One or both fields have a data value
{{else}}
Neither field has a data value
{{/or}} |
{
"item1": "100",
"item2": "15000"
} |
One or both fields have a data value. |
{
"item1": "",
"item2": ""
} |
Neither field has a data value. |