2022.2

Table Of Contents
4. TheDynamicSectionBackgroundScriptWizardcomposesthefilenames(includingthepath)
basedontheselectedlocation,theprefix,thevalueofadata field,andthesuffix.Thevariable
partofthefilenamesisthevalueofthedatafield(s)intheFieldcolumn.Theprefixandsuffixare
meanttocontainstaticpartsofthefilenames.
ClickthefirstfieldinthecolumnField,andthenclickthedownwardpointingarrow.Selectthe
datafieldtobeevaluated.
Ifyouwantthefilenametobecomposedofthevalueofseveraldatafields,simplyclickinthe
nextroworclicktheAddbutton.Thisaddsarow.Notethattherowswillbeconcatenatedtocom-
poseonefilename.Onlythelastsuffixshouldcontainthefileextension(.pdf).
5. ClickApplyorOK.
Thescriptassignstheresultingfilename,includingthepathandfileextension,totheURLofthe
section'sbackground.
6. NowclickthePreviewtabandbrowsethroughtherecordstoverifythatthescriptworksas
expected.
Ifyouwanttoseetheunderlyingscript,reopenthescriptandclicktheExpandbutton.Formoreinform-
ationonthistypeofscript,see"ControlScript:SettingaPrintsection'sbackground"onpage404).
Handlebars in OL Connect
HandlebarsisthenameofaJavaScriptlibrarythatimplementsatemplatinglanguage(see
https://handlebarsjs.com/).Itusesatemplateandaninputobjecttogenerateoutput.
ThetemplatelookslikeregulartextwithembeddedHandlebarsexpressions.Ahandlebarsexpression
issomecontentsenclosedbydoublecurlybraces:{{...}}.Forexample:
<p>Hello {{firstname}}!</p>
Whenthetemplateisrendered,theseexpressionsarereplacedwithvaluesfromaninputobject.
TheHandlebarslibraryisintegratedinOLConnectDesigner.ThismeansthatyoucanuseHandle-
barsexpressionsinallsections(asofversion2022.2),aswellasinaspecialtypeofsnippetscalled
"Handlebarstemplates"(asofversion2022.1).
l
Expressionsinsectionsareresolvedusingthecurrent recordwithwhichatemplateismerged.
Inotherwords,theinputobjectisthecurrentrecord.
l
ExpressionsinaDynamic Tableareresolvedusingthedetail recordassociatedwiththe
closesttablerow.(Nestedtablesaresupported,soasingledynamictablecanusemultipledetail
tables.)
l
InthecaseofHandlebars templates(snippets),youdetermineinascriptwithwhichdatathe
snippetwillbemerged.See"Handlebarstemplates"onpage339forinstructions.
Page 327