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.

override js file in etc/clientlibs

Avatar

Level 3

Is there a way to override the javascript file inside /etc/clientlibs.

Precisely I want to extend the functionality in /etc/clientlibs/granite/coralui2/optional/rte/js/components/rte/ui/dialogs/LinkBaseDialog.js file

3 Replies

Avatar

Administrator

Hi 

Please read this old thread, it will centainally help you:

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// overlay any js in my application which is under /etc/clientlibs/granite

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

Create /etc/clientlibs/<mysite>/<jsfile>

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

I hope this will help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 3

I tried the way you suggested but did not solve it. The js file in the new location is not being included to my site.

I have created a folder under etc/clientlibs with the site name and put the js file in there with a new category name and this category name as a dependency to my clientlib of site under etc/designs.

 

Please do suggest any alternative or if i went wrong in my approach.

 

Thanks in Advance.

Avatar

Administrator

Please try these:-

Option 1 :- 

1) Create your own client library "mylib" in /etc/designs or /etc/clientlib

2) Embed all required client libs

3) Add the <cq:includeClientLib categories="mylib" /> at the beginning of the page rendering process.

4) Check the generated HTML for inclusion of clientlibs. If there are more clientlibs loaded as this "mylib", modify your embed definition and go tostep 2.

 

Option 2:- 

Provide your own prototype function for some buggy implementation, then you can simply provide this in your clientlibs and make the original clientlibs as your dependency. This will ensure to load your clientlibs later, so the new implementation would be patched in.

 

Thanks and Regards

Kautuk Sahni
 



Kautuk Sahni