2021.1

Table Of Contents
Cloning a section
To clone a section, first use the clone() function and then add the clone to the Print context
before or after a specific section, using addAfter() or addBefore():
var printSections = merge.template.contexts.PRINT.sections;
var clone = printSections["Section 1"].clone();
printSections["Section 1"].addAfter(clone);
Cloned sections have the same properties as normal sections (see "section" on page1433),
but they cannot call the section functions clone(), addBefore() and addAfter(), which means
you cannot clone a clone, or use a clone as a starting point to insert other clones into a
template.
Note that with multiple clones, the next clone is always added after the previous clone.
With addBefore(), the code original.addBefore(clone1); original.addBefore(clone2); will
result in "clone1, clone2, original".
With addAfter() the code original.addAfter(clone1); original.addAfter(clone2); results
in "original, clone1, clone2".
Renaming a clone
By default, clones receive the name of their source section with a "Clone {unique identifier}"
suffix, for example:
Source: "Section 1"
Clone Name: "Section 1 Clone 71c3e414-fdf3-11e8-8eb2-f2801f1b9fd1"
Use the name property to assign another name to the cloned section, for example:
clone.name = "my_section_clone";
Just like section names, the clone's name should be unique - within the scope of a single
record, that is; across records, the same name can be used.
When two clones get the same name in the same record, one of the clones may no longer be
used. This is prevented by giving clones unique names. Unique names also ensure that
CSSrules and scripts can target a specific clone.
Targeting elements in a cloned section
Clones that have a unique name can be further personalized with the use of CSS style sheets
(see "Styling and formatting" on page736) and personalization scripts (see "Variable Data" on
Page 915