2021.1

Table Of Contents
Note
To remove a Media or Master Page via script, give it the value undefined, or null, or
an empty string (""); see the examples below.
Examples
This script retrieves a Print section and modifies a number of settings for all of its sheets.
let section = merge.template.contexts.PRINT.sections["Section 1"];
section.sheetConfig.positions.all.allowContent = AllowContent.ALL_
SIDES;
section.sheetConfig.positions.all.media = "MyMedia";
section.sheetConfig.positions.all.masterFront = "Master page 1";
section.sheetConfig.positions.all.masterBack = undefined; // or
null, or an empty string
The following script ensures that empty backsides of single sheets are omitted.
let section = merge.template.contexts.PRINT.sections["Section 1"];
section.sheetConfig.positions.single.omitMasterOnEmptyBackside =
true;
clone()
This function returns a copy of one HTML element or of a set of HTML elements, which can be:
l The elements that match the selector of a script (see "results" on page1427).
l One element that matches the selector of a script that runs for "Each matched element"
(see "this" on page1345 and "Setting the scope of a script" on page874).
l The elements returned by a query in the template (see "query()" on page1299).
See also: "Dynamically adding sections (cloning)" on page914.
To duplicate an existing template element, clone it before calling append(); see "append()" on
page1353.
Page 1412