2022.1

Table Of Contents
Note
Content provided by 'block helpers' - expressions in the form {{#helperName
arguments}}...{{/helperName}} - is not automatically HTML-escaped. See "Using logic in
a Handlebars template: helpers" below.
Using logic in a Handlebars template: helpers
Note
The information in this Online Help focuses on the implementation of Handlebars in OL
Connect. For general information about Handlebars and how to use it, see the following
web sites: https://handlebarsjs.com/ and https://devdocs.io/handlebars.
Block helpers
Functions that can be called from a Handlebars expression are called helpers. Handlebars
offers a number of built-in block helpers that let you use logic in templates. Block helpers look
like this: {{#helperName arguments}}...{{/helperName}}.
They are documented on Handlebars' website: https://handlebarsjs.com/guide/builtin-
helpers.html.
Of those helpers, the following are supported in OLConnect:
l #if: Conditionally renders a block. An optional {{else}} section inside the block will display
when the condition is not true.
l #unless: Renders a block if the expression returns a falsy value (i.e. a value that is
considered false when encountered in a Boolean context). An optional {{else}} section
inside the block will display when the condition is true.
l #each: Allows to iterate over a list. An optional {{else}} section inside the block will
display when the list is empty.
l #with: Can be used to work directly with the passed object or object property. An optional
{{else}} section will display only when the passed value is empty.
Page 452