2018.1

Table Of Contents
Field Type Description
sections Array
Array of sections (see "section" on page1084) inside a
particular context defined in the template.
Note: When using merge.context.sections keep in mind that
for example 'Section X' might only exist in your Print context, so
using merge.context.sections['Section X'] without
enclosing it in the if statement if (merge.context.type ==
ContextType.PRINT) {} will yield an error when the script runs
for other contexts.
Alternatively, use the template object to access a specific
context: merge.template.contexts.PRINT.sections['Section
X'].
type ContextType The context type: PRINT, EMAIL or WEB (see "ContextType"
on page1099).
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;
}
}
media
The media object can be used to specify, enable and position a stationery's front and back in a
Control Script (see "Control Scripts" on page711 and "Control Script API" on page1077).
Note that Media are only used in Print sections (see "Media" on page408).
The available media are listed in, and retrieved via, the template object (see "template" on
page1094), for example: var myMedia = merge.template.media.My_Media.
Page 1081