2022.2

Table Of Contents
ShowingorhidingelementsusingtheConditionalContentScriptwizard
TheConditionalScriptWizardhelpsyoutoshoworhideanelement–aparagraph,imageorother
HTMLelement-basedonthevalueofoneormoredatafieldsandruntimeparameters.Forexample,
youcouldcheckwhetherthedatafield'State'is'EqualTo'thevalue'BritishColumbia'or'Québec',to
includeaparagraphonlyforrecipientsinthosestates.
ToopentheConditionalScriptwizard:
l
Selectoneormoreelements,right-clickandchooseMake Conditional.
l
Alternatively,clicktheblacktriangleontheNewbuttonontheScriptspaneatthebottomleftof
thewindow,andclickConditional Content Script.
Inthewizard,firstmakethefollowingsettings.
1. Renamethescriptsothatitreflectswhatthescriptdoes.
Scriptscanonlyhavethesamenamewhentheyarenotinthesamefolder.(See
"Managingscripts"onpage814.)
2. TypeaSelector.Theselectorselectsoneormorepiecesoftextorelementsfromthetemplate,
sothattheconditionalcontentscriptcanhideorshowthosepieces.
AnID(forexample:#conditional-script)isbestifyouwanttoshoworhideoneelementonly.
Useaclassselector(forexample:.conditional)ifthescriptshouldshoworhidemorethanone
element.See"SelectorsinOLConnect"onpage825forfurtherexplanationonselectors.
WhenyoustarttheConditionalScriptWizardbyright-clickinganelement,theSelectorfieldis
pre-populatedwiththeelement'sIDandclass(orclasses).Iftheelementdidn'thaveanIDor
class,itgetsanewID(orclass,incasemultipleelementswereselected)thatisgeneratedauto-
matically.
Ifyou'dwanttochangetheselectorlater,youcandothatafterreopeningthescript(double-click
thenameofthescriptintheScriptspane).
3. SettheAction:usethedrop-downtoselectwhethertoShoworHidetheelementwhenthecon-
ditionbelowistrue.Whentheconditionevaluatestofalse,theoppositeactionisperformed.
Oncethesesettingshavebeenmade,theconditioncanbebuild.
The Addbuttonaddsarulethatevaluatesadata fieldtoagroup.
Toaddeitheragroup,orarulethatevaluatesaruntime parameter,clickthedownwardpointing
arrownexttothisbuttonandselectGrouporParameter Rule.
Creatingaparameterruleisonlypossibleifthetemplatecontainsruntimeparameters;see"Runtime
parameters"onpage429.
Page 735