Created
March 29, 2020 18:40
-
-
Save anfibiacreativa/8d99e53cb1c27c94a70e80309140878e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--/* Firsy of all, you need to import the clientlibs template */--> | |
<sly data-sly-use.clientLib="/libs/granite/sightly/templates/clientlib.html"> | |
<!--/* You can then use the call API, to call the right clientlib category, for the right use case. In the example below | |
you're calling the js files only, for the 'my.category' category */--> | |
<sly data-sly-call="${clientLib.js @ categories='my.category'}" /> | |
<!--/* Supposing you have special style rules for your authoring mode, you can test for wcmmode and include the right styles too | |
while avoid requesting them in publish, for performance sake */--> | |
<sly data-sly-call="${clientLib.css @ categories='my.category.author'}" | |
data-sly-test="${!wcmmode.preview}" /> | |
</sly> | |
<!--/* You can also call ALL your code, both js and css */--> | |
<sly data-sly-call="${clientLib.all @ categories='some.category'}" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment