2022.2

Table Of Contents
HandlebarstemplatescaninturnuseotherHandlebarstemplatesassnippets.Theyarecalled
partials.Howthisworksisexplainedinthetopic:"Partials"onpage342.
Moreaboutexpressionsandthefunctionsthatyoucanuseinexpressionscanbefoundinthetopics
"Handlebarsexpressions"belowand"Usingfunctionsinexpressions:Helpers"onpage330.
Note: TheinformationinthisOnlineHelpfocusesontheimplementationofHandlebarsinOL
Connect.ForgeneralinformationaboutHandlebarsandhowtouseit,seethefollowingweb
sites:https://handlebarsjs.com/andhttps://devdocs.io/handlebars.
Handlebars expressions
Note: TheinformationinthisOnlineHelpfocusesontheimplementationofHandlebarsinOL
Connect.ForgeneralinformationaboutHandlebarsandhowtouseit,seethefollowingweb
sites:https://handlebarsjs.com/andhttps://devdocs.io/handlebars.
Datainexpressions
Ahandlebarsexpressionissomecontentsenclosedbydoublecurlybraces:{{...}}.
Forexample:Hello {{firstname}}!
Initsmostsimpleformthecontentsoftheexpressionrefertoadatafield.Theywillbereplacedwiththe
valueofthatfieldifitexistsinthedatathatispassedtothetemplate.
l
Expressionsinsectionsarealwaysresolvedusingthecurrent recordwithwhichatemplateis
merged.Inotherwords,theinputobjectisthecurrentrecord.
l
InthecaseofHandlebarssnippets,youdetermineinascriptwithwhichdatathesnippetwillbe
merged.See"Handlebarstemplates"onpage339forinstructions.
ExpressionsareinsertedinsectionsandHandlebarstemplatesthesameway;see"Variabledatain
text:expressions"onpage307.
Itispossibletouselogicinanexpression,forexampletodisplaycontentonlyifafieldhasacertain
value.Howthisisdoneisdescribedinanothertopic:"BlockHelpers"onpage332.
Note: InOLConnect(asopposedtotheoriginalHandlebarslibrary),numbersinHandlebars
expressionsdonotneedtobesurroundedbyquotes.Forexample,tocalculate1+2youcan
write(add12)insteadof(add"1""2").
Accessing data at different levels
Afieldorkeynamewithouta.or/isassumedtorefertoafieldortableattherootofthedatawith
whichthetemplateisrendered.Thereareanumberofwaystoaccessdatathatisnotlocatedatthe
root.
Page 328