I'm using $CMS_RENDER(script:"...")$ in a page template in order to execute a script during generation. How do I access the currently generated page within the script, e.g. during preview generation? I tried context.getPage(), context.getGenerationContext().getPage() and some other accessors, but the result always seems to be null.
Thanks. That will do it. But just out of curiosity: I expected to find the page somewhere in the generation context without passing it as a parameter. What is the reason that it's not there?