2021.2

Table Of Contents
Field Type Description
type "ContextType" on
page1440
The context type: PRINT, EMAIL or WEB.
Function Description
"query
(selector)"
on
page1446
Runs a query across all sections in the Print context. This function is only
available in Post Pagination Scripts, which are only applied to the Print
context. See "Post Pagination Scripts" on page929.
Example
This script checks if the output channel is EMAIL and if the context to be merged is the Print
context (which happens if the Print context is attached to an email). If this is the case, it includes
and excludes certain Print sections from the output.
if (channel == Channel.EMAIL) {
if (merge.context.type == ContextType.PRINT) {
merge.context.sections['Section 1'].enabled = false;
merge.context.sections['Section 2'].enabled = false;
merge.context.sections['Section 3'].enabled = true;
}
}
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913 and
"Control Script API" on page1405). 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506).
In script, Master Pages are retrieved via the masterpages Array which contains all Master
Pages in the current template (see "template" on page1436).
For example: var myMasterpage = merge.template.masterpages["Master page 1"];.
Page 1409