OL Learn

How to get the current section?

Hi,

In the control script, can you actually get the current section being used without specifying the name? or am I understanding this wrong.

For eg: across all scripts can I possibly go:

currentSection = merge.template.context.Print.getCurrentSection();
name = currentSection.name;
....
...

Thanks in advanced.
E

Hi @edanting,

Control scripts determine the sections to use, so there is no current section yet while control scripts are running.

The merge engine performs the following steps:

  1. Run control scripts, during which sections can be enabled/disabled or cloned
  2. For each enabled section/clone: Run standard scripts
    2a. Paginate, during which master pages are applied
    2b. For each applied master page: Run standard scripts
  3. For each enabled section/clone: Run post-pagination scripts

For standard scripts and post-pagination scripts “merge.section” returns the current section.

1 Like

Awesome thanks for that!

For standard scripts and post-pagination scripts “merge.section” returns the current section.

This is really what Im after. cheers!

Regards,
E