ContextType
ContextType is an enumeration for the types.
The type of the context that is going to be merged next can be retrieved via type : merge.context.type .
The context type needs to be specified when retrieving a with merge.template..ContextType.["section name"] , for example merge.template.contexts.PRINT.sections["Section EN"] .
HTML_EMAIL |
The context is the Email context.
|
PRINT |
The context is the Print context. |
WEB |
The context is the Web context. |
Example
This 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;
}
|
|