data-sly-include vs data-sly-call/data-sly-template | Community
Skip to main content
selvaganesh
New Participant
October 27, 2016
Solved

data-sly-include vs data-sly-call/data-sly-template

  • October 27, 2016
  • 2 replies
  • 10722 views

When to  use data-sly-include   vs  data-sly-call/data-sly-template

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

Feike_Visser1
Feike_Visser1Accepted solution
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.

edubey
New Participant
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