2022.2

Table Of Contents
Forexample,apartialthatisregisteredasfollows:
Handlebars.registerPartial('clauses', 'snippets/partials/clauses.hbs');
canbeincludedinaHandlebarstemplatewiththefollowingexpression:{{>clauses}}.
When a partial is missing
Ifthereisnopartialwiththespecifiedname,Handlebarscangeneratesomeothercontent,calledfail-
over content.Failovercontentcanbespecifiedusingblocksyntax.Theexpressionthatcallsthepar-
tialisthestartofablock.Anexpressionwithaclosingtagandthenameofthepartialsignalstheendof
theblock.Thecontentbetweentheseexpressionswillbeusedifthecalledpartialismissing.
Forexample:{{#>myPartial}}Failovercontent{{/myPartial}}willrender"Failovercontent"ifthe
"myPartial"partialisnotregistered.
Dynamic partials
Toloadpartialsdynamically,basedondata,youcoulduseablockhelper(see"Usingfunctionsin
expressions:Helpers"onpage330and"UsingHandlebarstemplates:examples"onpage342).
Itisalsopossibletodynamicallyselectapartialbyusingasub expressionbetweenparentheses.The
subexpressionshouldevaluatetothenameofapartial.
Forexample,ifwhichPartialisafunctionthatreturnsthenameofapartial,{{> (whichPartial)
}}inaHandlebarstemplatecallswhichPartialandthenrendersthepartialwhosenameisreturned
bythisfunction.
Notethattouseafunctioninthisway,itmustberegisteredasaHelper.See"CreatingcustomHelp-
ers"onpage336.
Inline partials
Inlinepartialsaresupportedaswell.Seethetwoexamplesathttps://-
docs.w3cub.com/handlebars/partials#inline-partials.
Unsupportedfeatures
ThefollowingHandlebarspartialsfeaturesarenotsupportedinOLConnect.
l
Passingacustomcontextasaparameter.
l
Passinghashparameters(seehttps://devdocs.io/handlebars/partials#partial-parameters).
Handlebars API
ThistopicliststhefunctionsofHandlebarsthataresupportedinDesignerscripts.Italsolistsfeatures
thatareunsupportedinOLConnect.
Page 344