{{#match}} allows for simple comparisons, and executing different template blocks depending on the outcome.
Like all block helpers, {{#match}} supports adding an {{else}} block or using ^ instead of # for negation - this means that the {{#match}} and {{else}} blocks are reversed if you use {{^match}} and {{else}} instead. In addition, it is possible to do {{else match ...}}, to chain together multiple options like a switch statement.
Example usage
Thematch helper is handy when paired with custom theme settings using @custom:
Operators
Match supports the following operators=- equals (default when no operator provided)!=- not equals>- greater than>=- greater than or equals<- less than<=- less than or equals~- contains~^- starts with~$- ends with
Equality
match supports comparing values for equality, which is the default behaviour:
String comparisons
Support for contains~, starts with ~^ and ends with ~$, using the same syntax as NQL filtering
Numeric comparisons
The match handler supports>, <, >= and <= operators for numeric comparisons.
Evaluation rules
Values passed tomatch are tested according to their value as well as their type. For example:
match can also be used to test boolean values similar to if:

