Articles in this section

#neither helper

This helper is used for building true/false arguments.

{{#neither field field}} expr {{else}} expr {{/neither}}
  • If both parameters are equal to false, the first expression displays.

  • If one or both are equal to true, the {{else}} expression statement displays.

In this example, both the values in the Context are blank /null (which makes the argument true), so the first expression is printed to output.

Template

{{#neither item1 item2}}
  Values are absent for the specified parameters.
{{else}}
  Only one of the parameters has a value.
{{/neither}}

Context

{
  "item1": "",
  "item2": ""
}

Output

Values are absent for the specified parameters.

In this example, only one of the Context variables is blank, so the argument will pass the {{else}} statement to the output.

Template

{{#neither item1 item2}}
  Values are absent for at least one of the specified parameters.
{{else}}
  Only one of the parameters has a value.
{{/neither}}

Context

{
  "item1": "",
  "item2": "5"
}

Output

Only one of the parameters has a value.