In some of my HTL files i am using a use api script, which is in path /apps/level1/level2/file.js. To call this script from my HTL file, i am using the following code.
<div data-sly-use.file="${'/apps/level1/level2/file.js' @ args=something}">${file}</div>
I am doing the same thing at different parts of the same or different HTL file. is there anyway i could use a seperate template like file to store these paths, then call them at the necessary HTL files like.
<sly data-sly-include.variable="variables.html"/>
//rest of the code
<div data-sly-use.file="${variable.file1 @ args=something}">${file}</div>
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
you can use within a file but from another file. data-sly-include, replaces the content of the host element with the markup generated by the indicated HTML template file (HTL, JSP, ESP etc.) when it is processed by its corresponding template engine. The rendering context of the included file will not include the current HTL context (that of the including file);
<data-sly-set.api="${'test.js'}" />
<sly data-sly-use.product="${api}" />
you can try using data-sly-template
Hi,
you can use within a file but from another file. data-sly-include, replaces the content of the host element with the markup generated by the indicated HTML template file (HTL, JSP, ESP etc.) when it is processed by its corresponding template engine. The rendering context of the included file will not include the current HTL context (that of the including file);
<data-sly-set.api="${'test.js'}" />
<sly data-sly-use.product="${api}" />
you can try using data-sly-template
@arunpatidarthanks for the reply. can you provide me an example? it would be really helpful.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies