I must (project requirement) create some markup directly in Javascript on the server side and then integrate it into the HTL output without further modification.
The following two-liner works for me:
<sly data-sly-use.markup="${'render.js'}" />
${markup @ context='unsafe'}
But I am wondering if there is a way to shorten it further?
In the Adobe documentation I find other sly- block statements like sly-template and sly-resource that can include the output of some other HTL or JSP file directly, but is the same also possible with a Javascript file?
Like this:
<sly data-sly-magicmagicmagic="${'render.js'}" />
?
No, there is no such
thingamajig;)You can however write it a bit nicer as
I stronly suggest you use the
htmlcontext though.