Expand my Community achievements bar.

SOLVED

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

Avatar

Level 6

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

1 Accepted Solution

Avatar

Correct answer by
Employee

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.

View solution in original post

2 Replies

Avatar

Level 10

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

Avatar

Correct answer by
Employee

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.