2022.2

Table Of Contents
clone.name = "my_section_clone";
Justlikesectionnames,theclone'snameshouldbeunique-withinthescopeofasinglerecord,thatis;
acrossrecords,thesamenamecanbeused.
Whentwoclonesgetthesamenameinthesamerecord,oneoftheclonesmaynolongerbeused.This
ispreventedbygivingclonesuniquenames.UniquenamesalsoensurethatCSSrulesandscriptscan
targetaspecificclone.
Targeting elements in a cloned section
ClonesthathaveauniquenamecanbefurtherpersonalizedwiththeuseofCSSstylesheets(see
"Stylingandformatting"onpage260)andpersonalizationscripts(see"Personalizingcontent"on
page297and"Writingyourownscripts"onpage368).
Theselectortouseis:[section="name of the clone"].
ThefollowingCSSstylerulestargetthe<h1>elementinanumberofclonesandassigntherespective
textadifferentcolor:
[section="my_section_clone_0"] h1 { color: red; }
[section="my_section_clone_1"] h1 { color: green; }
[section="my_section_clone_2"] h1 { color: blue; }
Thesameselectorcouldbeusedinpersonalizationscripts:
Selector:[section="my_section_clone_0"]h1
Script:results.css('color','red');
InsideaStandardScript,clonedsectionscanbefoundusingmerge.section:
if (merge.section == "my_section_clone_0") {
results.html("Clone!");
} else {
results.html("Original.");
}
NotethatinaControlScript,merge.sectionisonlydefinedwhentheoutputchannelisWEB;see
"merge"onpage856.
Examples
Cloning a section based on the number of records in a detail table
Thisscriptcreatesasmanyclonesofasectionastherearerecordsinadetailtable.Itassignsthenew
sectionsauniquename.
Page 407