I have a problem similar to this one: Sightly in <script> tag not evaluating?
In that thread, the problem was that Sightly expressions inside a script element were not being rendered, and the solution was to add @ context = 'scriptString' to the expression.
My situation is a slightly different: Inside my HTML script element, I want to put a Sightly element:
<script id="availabilitiesTemplate" type="text/template" >
<sly data-sly-include="availabilitiesTemplate.html"></sly>
</script>
But the included file is not rendered to the output.
I suspect this is also a context problem, but I can't find any docs on setting the context on a <sly> element, and none of my experiments have worked. I've tried setting the context:
<script id="availabilitiesTemplate" type="text/template" >
<sly data-sly-include="${ availabilitiesTemplate.html @ context = 'scriptString' }"></sly>
</script>
I've also tried assigning the template with a data-sly-use expression:
<sly data-sly-use.avail="availabilitiesTemplate.html"></sly>
<script id="availabilitiesTemplate" type="text/template" >
${avail @ context='scriptString'}
</script>
Neither of these approaches works either; in all cases the output is
<script id="availabilitiesTemplate" type="text/template" >
</script>
Is there any way to get a <sly> element to render inside a <script> element?