data-sly-include vs data-sly-call/data-sly-template | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1

Sometimes I explain data-sly-template as a HTML-function ( you can call it multiple times, pass in parameters etc).

data-sly-include is to include other html/jsp resources.

2 replies

edubey
Level 10
October 28, 2016

Here is basic stuff reg their usage:

data-sly-template: Template is the way by which you render one content with different behavior by passing different params. So create a template which renders html and value can be passed dynamically. Logically it can be co-related to the way you use any function by passing different params. Check this out http://adobeaemclub.com/guide-for-working-with-templates-and-call-in-sightly-aem-6-1/ 

data-sly-include: It will include or replace with the content of file you are including here. It can be html, jsp, js, etc. Same content will be rendered apart from the logic you have put inside that html, jsp

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
October 28, 2016

Sometimes I explain data-sly-template as a HTML-function ( you can call it multiple times, pass in parameters etc).

data-sly-include is to include other html/jsp resources.