override js file in etc/clientlibs | Community
Skip to main content
Level 2
May 16, 2016

override js file in etc/clientlibs

  • May 16, 2016
  • 1 reply
  • 3091 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

kautuk_sahni
Community Manager
Community Manager
May 17, 2016

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-manager.topic.html/forum__djwt-hi_how_to_overla.html

// 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
Level 2
May 18, 2016

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.

kautuk_sahni
Community Manager
Community Manager
June 23, 2016

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