Closed rajavijaysingh closed 4 years ago
the current engine does not allow to specify a template in another template. from the spec it's not clear if this is allowed or not: https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#22101-template
@raducotescu is this allows in the sling htl engine?
The Sling HTL engine does not allow [0] nested templates and we've never supported this.
thanks. so closing this as wont-fix.
@tripodsan, I think it is not about nested templates, but template calling another template. Correct me if I'm wrong, but I understand that the code @raducotescu pasted is to detect cases like:
<template data-sly-template.foo="${@ a}">
<template data-sly-template.bar="${@ a}">
template code
</template>
</template>
The bar
is disallowed nested template in this snippet.
In Sling based application I created:
test/component.html
:
<div data-sly-use.lib="templatesLib.html" data-sly-call="${lib.foo @ a=123}"></div>
test/templatesLib.html
:
<template data-sly-template.foo="${@ a}">
<div data-sly-use.lib="templatesLib1.html" data-sly-call="${lib.bar @ a=a}"></div>
</template>
test/templatesLib1.html
:
<template data-sly-template.bar="${@ a}">
<section>${a}</section>
</template>
I think this is the case that @rajavijaysingh wanted to report and in Sling it works without any issues.
hmm..ok. I'll try to reproduce this. thanks for the clarification @karollewandowski
I see...you can move the lib outside of the <template/>
element:
<sly data-sly-use.lib="templatesLib1.html" />
<template data-sly-template.foo="${@ a}">
<div data-sly-call="${lib.bar @ a=a}"></div>
</template>
but I see if I can split the statements internally....
:tada: This issue has been resolved in version 3.2.6 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Currently in the call_spec.txt, the test to validate "sightly call function can call other templates" is working, but when the same is done by having the templates loaded using data-sly-use, it is not working in the
templateLib.html
added the below snippetcreated a new file
templateLib1.html
undertemplate_spec
folder with the below codeand if we test with the below snippet
we are getting error `
`