Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Override /etc/clientlibs/granite js

Avatar

Level 2

Hi,

How to overlay jquery/underscore or any other js in my application which is under /etc/clientlibs/granite. 

Options I have tried which didn't workout:

1) Under /etc/designs/<my-site> created a clientlib with same categorie name as "jquery/underscore" under /etc/clientlibs/granite.

2) Created a underscore.js file in /etc/designs/<my-site>/<my-clientlib> which is added in js.txt

Note: When we tried to overlay some widgets js under "libd/foundation", the same folder structure we created under /apps/<mysite> and that worked.

 

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Out of the box there is no option to overlay /etc.  Create a sperate category library & include same in your template. 

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Out of the box there is no option to overlay /etc.  Create a sperate category library & include same in your template. 

Avatar

Level 2

"If include in template" here means direct <script> tag inclusion in jsp ? This is not working as granite js is overriding this js.

Creating seperate category library - Do you mean clientlib category ? If yes what is the path I need to create under /apps and /etc ? But I tired both, that is not working.

The below way it is working:

Created /etc/clientlibs/<mysite>/<jsfile>

Added this js category in /etc/designs/<mysite>/<myclientlib> as dependecy.

Can we use the above approach ?