Hi all …
I have a macro that should render structurally different for pdf exports.
I could write some flag somewhere in the metadata script of the pdf template, that is executed for every exported script. I tried to write to xcontext as follows:
{{velocity output="false"}}
$xcontext.put('data-export': 'true')
{{/velocity}}
and then inside the macro, I tried to read it:
{{groovy}}
if (xcontext.get("data-export"))
println("export")
else
println("no export")
{{/groovy}}
But it seems, that the xcontext is not shared between the template script and the macro script.
Are there any alternative approaches?
Thanks in advance
Holger