template
The template object represents the template with all its and . It is used frequently in Control Scripts (see Control Scripts and Control Script API).
It is retrieved via the merge object: merge.template (see merge).
Which contexts are available in the template can be queried using merge.template.contexts . To get access to a specific , you have to specify the ContextType (see ContextType).
contexts |
Array |
Array of contexts (see context) available in the template. The contexts contain the sections (see section). |
Example
The following Control Script retrieves two Print sections. Then, depending on a value in the current record, it enables one section or the other, so that only one of the two sections appears in the output. var printSections = merge.template.contexts.PRINT.sections;
printSections['Section EN'].enabled = false;
printSections['Section FR'].enabled = false;
if(record.fields.Language === 'FR'){
printSections['Section FR'].enabled = true;
} else {
printSections['Section EN'].enabled = true;
}
|
|