Hi
I would like to use data-sly-resource to render a HTL that is somewhat different then the existing one.
I tried using selectors='overview'
data-sly-resource="${event.resource @ resourceType='xxx/components/content/eventTeaser', selectors='overview'}">
and created a copy of eventTeaser called eventTeaser.overview.html.
The problem is that the new HTL template eventTeaser.overview.html is not called but instead the eventTeser.html is called.
Of course eventTeaser.overview.html exists and it is in the same directory as eventTeaser.html is.
What am I doing wrong here and what would be a good solution for this?
data-sly-resource="${event.resource @ resourceType='xxx/components/content/eventTeaser',appendPath='eventTeaser.html' addSelectors='overview'}">
I guess, you can try something like this.
Hi,
thanks for writing.
I tried it exactly like your wrote but it is again using the eventTeaser.html and not the eventTeaser.overview.html.
@anasustic In that case you could try to create "overview.html" instead of eventTeaser.overview.html and try this-
data-sly-resource="${event.resource @ resourceType='xxx/components/content/eventTeaser', addSelectors='overview'}">
Hi @anasustic ,
In this case, you just need to create "overview.html".
This "eventTeaser.overview.html" would have worked if there was a folder "eventTeaser" and overview.html inside it.
Check your Sling's recent request to trace the request and get more information.
http://localhost:4502/system/console/requests
Also, check this cheatsheet for sling resolution
Hope that helps!
Regards,
Nitesh
Thank you so very much @nitesh_kumar for your answer and your suggestion about the tracing that the cheatsheet. Super valuable resources
Views
Likes
Replies