2022.2

Table Of Contents
Showingorhidingseveralelementswithoneconditionalscript
Toapplyoneconditionalcontentscripttoseveralelements,aCSSclassorHTMLelementneedstobe
usedastheselectorofthescript.Whenyouselectmultipleelementsandcreateanewconditionalcon-
tentscriptfollowingtheactionsdescribedin"ShowingorhidingelementsusingtheConditionalContent
Scriptwizard"onpage318,aCSSclasswillbeappliedautomatically.
Ifyouhavecreatedthescriptyourself,orifyouwantascripttoapplytomoreelementslateron,you
havetodothismanually.
1. Double-clicktheconditionalscriptintheScriptspanetoreopenit.
2. MakesurethattheselectorisaCSSclass(forexample,.male)oranHTMLelementwithacer-
tainCSSclass(forexample,p.male).See"SelectorsinOLConnect"onpage385forfurther
explanationonselectors.
3. ApplythesameCSSclasstoallelementsthatshouldbeshownorhiddenunderthecondition
thatyouhavesetintheconditionalscript.Clickeachelementandtypetheclass(withoutthepre-
cedingdot)intheClassfield.
Showingorhidingatextselection
Whenyouright-clickonanelementandmakeitconditional,theelementasawholewillbemadecon-
ditional.Thishappensevenwhenyouselectafewwordsinaparagraphandright-clickthosewords;
theparagraphasawholewillbemadeconditional.
Itis,however,possibletoshoworhideapartofaparagraph.
Ifthetextthatyouwanttoshoworhideisshort,youcouldusetheSelector and Textoptioninthe
ConditionalContentwizardandcopythetextintotheTextfield.Thisoptionusesthespecifiedselector
asatriggerforthescript.Thescriptappliestoallinstancesofthetextfoundwithinthespecified
selector.
Searchingfortextcanbealengthyoperation,comparedtosearchingforanelementwithanID.Ifper-
formanceisanissue,ofifthesearchtextislong,abetteralternativeistowrapthetextinaspanele-
mentfirst.
1. Selectthepartofthetextthatyouwanttomakeconditional.
2. Right-clicktheselectedtextandclickWrap in span.
3. TypeanIDand/oraclass.AnIDisfineifthisistheonlythingthatshouldbeshownorhiddenon
agivencondition.Useaclassifthereismorethatshouldbeshownorhiddenonthesamecon-
dition.
4. StartcreatingaconditionalcontentscriptfromtheScriptspane.UsetheIDorclassasthe
selectorofthescript.See"ShowingorhidingelementsusingtheConditionalContentScriptwiz-
ard"onpage318.
Page 321