2020.1

Table Of Contents
masterpage
The masterpage object is used to set a Master Page's header and footer or to replace its entire
HTML body. It can only be accessed in Control Scripts (see "Control Scripts" on page879 and
"Control Script API" on page1355). Trying to access it in another type of script will result in an
error.
Note that Master Pages are only used in a Print context (see "Master Pages" on page478).
In script, Master Pages are retrieved via the masterpages Array which contains all Master
Pages in the current template (see "template" on page1383).
For example: var myMasterpage = merge.template.masterpages["Master page 1"];.
Functions and fields
Field Type Description
"html(value)"
on
page1382
Sets the initial HTML of the body element.
"margins" on
page1408
Margins Allows to set the header and footer of a Master Page, using a
Measurement string, for example: "2in" (this sets a margin to two
inches).
html(value)
Replaces the contents of the <body> of a section or Master Page with the supplied value. This
function is only available in Control Scripts. See also: "section" on page1400 and
"masterpage" above.
value
A String that may contain HTML tags.
Examples
The following script loads a snippet based on the value of a field, and then replaces the content
of a Print section with the snippet using html().
Page 1360