1.8

Table Of Contents
clone.name = "my_section_clone";
The section name must be unique within the scope of a single record.
Note
It is recommended not to use a random value or a time stamp in the name of a section. Although
section names must be unique within the scope of a record, across records it is advisable to keep
using the same name for the same clone, to avoid hitting the limit of the number of unique clones
that can be created throughout a job (see the previous note).
Targeting elements in a cloned section
As each clone receives a unique section name, one could use CSS style sheets (see "Styling
and formatting" on page198) and personalization scripts (see "Variable Data" on page247 and
"Writing your own scripts" on page260) to further personalize the cloned sections.
The following CSS style rules target the <h1> element in a number of clones and assigns the
respective text a different color:
[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 selectors could be used in personalization scripts:
Selector: [section="my_section_clone_0"] h1
Script: results.css('color','red');
In a template script, cloned sections can be found using merge.section:
if (merge.section == "my_section_clone_0") {
results.html("Clone!");
} else {
results.html("Original.");
}
Note that in a Control Script, merge.section is only defined when the output channel is WEB;
see "merge" on page563.
Page 292