2022.2

Table Of Contents
l
div-dividestwonumbervalues
l
startsWith-testsifastringstartswithacertainprefix
l
endsWith-testsifastringendswithacertainsuffix
l
matches-testsifastringmatchesaregularexpression
Thesecanbeusedas expression(returnstheresult).
Example: <p>Recurseverymonth:{{eq'Monthly'recurrence}}</p>
Thisexpressionreturns"true"ifthevalueofthedatafieldrecurrenceis'Monthly'.
Theycanalsobeusedin subexpressions,forexampleofaBlockHelper.
Example: <p>{{#if(eq'Monthly'recurrence)}}Recurseverymonth{{/if}}</p>
ThisBlockHelperoutputs"Recurseverymonth"ifthevalueofthedatafieldrecurrenceis
'Monthly'.
BlockHelpers
BlockHelpersareaspecialkindofHelpers.Theylooklikethis:
{{#helperName arguments}} ... {{/helperName}}
Handlebarsoffersanumberofbuilt-inBlockHelpersthatletyouuselogicintemplates.Theyaredoc-
umentedonHandlebars'website:https://handlebarsjs.com/guide/builtin-helpers.html.
OfthoseHelpers,thefollowingaresupportedinOLConnect:
l
#if:Conditionallyrendersablock.Anoptional{{else}}sectioninsidetheblockwilldisplaywhen
theconditionisnottrue.
l
#unless:Rendersablockiftheexpressionreturnsafalsyvalue(i.e.avaluethatisconsidered
falsewhenencounteredinaBooleancontext).Anoptional{{else}}sectioninsidetheblockwill
displaywhentheconditionistrue.
l
#each:Allowstoiterateoveralist.Anoptional{{else}}sectioninsidetheblockwilldisplaywhen
thelistisempty.
l
#with:Canbeusedtoworkdirectlywiththepassedobjectorobjectproperty.Anoptional{{else}}
sectionwilldisplayonlywhenthepassedvalueisempty.
InBlockHelpers,thedatavariables@first,@last,@indexcanbeused;seehttps://handle-
barsjs.com/api-reference/data-variables.html.
Page 332