2022.2

Table Of Contents
l
With.or/youcannavigatedownintotherecordorobject.Forexample:{{Cars.Brand}}and
{{Cars/Brand}}refertothesamefield.
Notethattoaccessaniteminadetailtableorarraydirectly,youalsohavetonavigatedown.For
example:Cars.Brand.Models[0]referstothefirstiteminModels.Alternativelyyoucanwrite:
Cars.Brand.Models.0
l
@rootrepresentsthetoplevelofthedata.
Ifatemplateisrenderedwiththecurrentrecordorpartofit,@rootreferstotherootofthecurrent
record.
WithaJavaScriptobject,@rootreferstotherootlevelofthedatathatwaspassedtotheHandle-
barstemplate.
l
Thebuilt-inhelpers#eachand#withdiveintoanobject-property,givingyoudirectaccesstoits
properties.(See"Usingfunctionsinexpressions:Helpers"onthefacingpageandthedoc-
umentationofHandlebars.)
l
Use../tonavigateonelevelup.Thisisparticularlyusefulin#eachand#withblocks.
Note: IfaHandlebarstemplateisrenderedwithpartofthecurrentrecord,thetemplatestill
hasaccesstotheentirerecordandcannavigateupandoutsideofthatpart,toahigher
levelinthecurrentrecord.
IfaJavaScriptobjectispassed,thetemplateonlyhasaccesstothepasseddata,andit
doesnothaveaccesstothecurrentrecord.
Formattingvalues
FunctionsthatcanbeusedinaHandlebarsexpressionarecalled"Helpers".OLConnectprovidesa
numberofHelperstoformat the valuethatistheresultofanexpression.Forexample:{{upperCase
FirstName}}returnsthevalueoftheFirstNamedatafieldinuppercase.
Theavailablefunctionsarelistedinthetopic:"FormatHelpers"onpage334.
HTMLvalues
ThevaluereturnedbyanexpressionisHTML-escaped.Thismeansthatcharactersthathaveaspecial
functioninHTML:& < > \" ' ` =arereplacedwithHTMLcharacterreferences.Forexample:&willbe
changedinto&amp;.
Takethisexpression:<span>{{foo}}</span>.
Ifthefieldfoocontainsa'>'andyoudon'tHTML-escapeit,thiswouldproduceinvalidHTML:
<span>...>...</span>.
AfterHTML-escaping,itbecomesvalidHTML:<span>&gt;</span>.
Page 329