Hi Roy, HTL does not allow arbitrary inclusion of scripts output. The scripts output for data-sly-include is appended to the current element content. The proper way to add attributes would be to use data-sly-attribute and provide the attributes from a Use API object and not from an external script.
That said, for your example it would probably be nicer to throw a parsing error instead of simply passing through/ignoring the <sly and /> fragments. Vlad On Fri, Oct 28, 2016 at 3:20 PM, Roy Teeuwen <r...@teeuwen.be> wrote: > To clarify further, because a part of the script was missng: > > I am doing <div class="block block--grid-block” <sling:call > script=“analytics-attributes.jsp”/> > </div> > > If i do the following in sightly: <div class="block block--grid-block” > <sly data-sly-include=“analytics-attributes.jsp”/> > </div> The following > output is created (see the wrongly put sly tag): > > <div class="block--grid-block" <sly="" style="height: 298px;"> > data-analytics-page-id=“page id" > data-analytics-page-type=“page-type" > </div> > > Greetings, > Roy > > On 28 Oct 2016, at 13:39, Roy Teeuwen <r...@teeuwen.be> wrote: > > > > Hey all, > > > > When using HTL, how does one include attributes in a div when it’s > coming from another script? In jsp we would be able to do it like the > following: > > > > <div class="block block--grid-block" > > <sling:call script="analytics-attributes.jsp"/> > >> > > > > This doesn’t seem possible in sightly in a way I can find? > > > > Greetings, > > Roy > >