Tuesday 16 January 2018

How to include clientlib in the html file using sightly

The client library can be included by using the below code::
The first line declares a clientlib object, which is implemented as a template. Then css or js is called based on the categories.

<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"></sly>
<sly data-sly-call="${clientlib.css @ categories='category.name'}"></sly>

To call css
data-sly-call="${clientlib.js @ categories='clientlib1,clientlib2'}" 

data-sly-call="${clientlib.css @ categories='clientlib1,clientlib2'}"

To call both css and js
data-sly-call="${clientlib.all @ categories='clientlib1,clientlib2'}"/>

No comments:

Post a Comment

extraClientlibs Usage

The purpose of property "extraClientlibs" is to selectively load client library for a dialog. This prevents the unnecessary load o...