Hi,
With version 2018.1.6 I can toggle web sections (in Control script) by such a syntax:
merge.template.contexts.WEB.sections[‘Section 1’].enabled = false;
merge.template.contexts.WEB.sections[‘Section 2’].enabled = true;
But with 2019.2.0 it doesn’t work
Even this syntax doesn’t work:
merge.context.sections[‘Section 1’].enabled = false;
merge.context.sections[‘Section 2’].enabled = true;
How to manage sections in WEB channel ?
Erik
2
I don’t have that version running but the following works in 2021.1.
merge.context.sections['Section 1'].enabled = false;
merge.context.sections['Section 2'].enabled = true;
Or
if (merge.context.type == ContextType.WEB ) {
merge.context.sections['Section 1'].enabled = false;
merge.context.sections['Section 2'].enabled = true;
}
Or
if (merge.context.type == ContextType.WEB && 'bar' === record.fields.foo) {
merge.context.sections['Section 1'].enabled = false;
merge.context.sections['Section 2'].enabled = true;
}