2022.2

Table Of Contents
ToswapaPrintsection'sbackgrounddynamically,youcanusetheDynamicBackgroundScriptWiz-
ard;see"DynamicPrintsectionbackgrounds"onpage325.
Snippets
Snippetsarepiecesofcontentthatcanbere-usedwithinthesametemplate,inallcontextsandsec-
tions.Snippetscancontainanycontentsthatasectioncanhave,suchastext,images,variabledata,
dynamictables,etc.Theyareoftenveryusefultopersonalizecontent,especiallyincombinationwith
variabledataandscripts.See"Snippets"onpage250and"Loadingasnippetviaascript"onpage391.
Handlebarssnippets
HandlebarstemplatesareaspecialkindofsnippetsinwhichyoucanuseHandlebarsexpressions.The
expressionsgetreplacedwithvalueswhenthesnippetismergedwithdata.Youdetermine-inavery
smallscript-withwhichdatathesnippetwillbemerged.See"Handlebarstemplates"onpage339for
instructions.
HandlebarsisthenameofaJavaScriptlibrarythatimplementsatemplatinglanguage(see
https://handlebarsjs.com/).Itusesatemplateandaninputobjecttogenerateoutput.TheHandlebars
libraryisintegratedinOLConnectDesigner.See:"HandlebarsinOLConnect"onpage327.
Scripts
AssoonasyouwanttodomorethanwhatcanbedonewiththeavailableScriptWizards,self-made
scriptsarethesolution.Youcould,forexample,combinedataoftwoormoredatafieldsinacondition
forconditionaltext.Oryoucouldloadapartofasnippetdependingonthevalueofadatafield.Witha
self-madescriptyoucanachieveanythingthatcanbedonebyanyoftheScriptWizards,andmuch
more.
Thebasicsofscript-writingintheDesignerareexplainedinthefollowingtopic:"Writingyourown
scripts"onpage368.
ControlScripts
Whenoutputisgeneratedfromatemplate,ControlScriptsrunbeforeallotherscripts,whenarecordis
mergedwithacontext.Theydeterminehowdifferentsectionsofthecontextarehandled.Theycan,for
example,makethepagenumberingcontinueoverallPrintsections,splitEmailattachments,oromit
Printsectionsfromtheoutput.
SomefunctionalityisprovidedasaScriptingWizard,forexampleConditionalPrintSections.
See"ControlScripts"onpage398.
PostPaginationScripts
PostPaginationScriptsareruninaPrintcontextafterthecontenthasbeenpaginated.Becausethey
cansearchthroughtheoutputofallPrintsections,andmodifyPrintsections(oneatatime),theymay
Page 298