Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Overlaying Libs ClientLib file for custom code entry

Avatar

Community Advisor

Hi,

I'm trying to add some custom code in /libs/cq/gui/components/authoring/clientlibs/editor/js/edit/edit.Toolbar.js. 

I need to overlay this file in etc.

How can I do that?

Thanks,

Himanshu

2 Replies

Avatar

Administrator

Please anyone correct me if I am wrong, there is no overlaying of clientlibs.

Clientlibs are registered globally via a 'Category Name'. Category are then called on to be placed into a page.

If you create a custom javascript, and add it to a category that already exists, say 'cq.authoring.dialog' then when that clientlib is called, that code gets called as well. If you create a file that already exists in the clientlib, it doesn't replace that file during clientlib resolution, it just gets stacked onto it.

There is a tool that might help explain this concept:
http://localhost:4502/libs/granite/ui/content/dumplibs.html

The hard part about a single category that are being created from multiple areas, is the script resolution order.

Another link that might help, as I believe they go into validation inside of AEM dialogs, is this AEM Gem of Customizing Dialogs:
https://docs.adobe.com/ddc/en/gems/customizing-dialog-fields-in-touch-ui.html

 

 

You can just extending the clientlib, and this is performed just putting in your clientlib the same categories of foundation clientlib.

~kautuk



Kautuk Sahni

Avatar

Community Advisor

Well, scenario is, we're using AEM 6.0 with SP2. And, there's this limitation that node doesn't create automatically for directly included component. We need to go to crx/de to that particular page path to add node manually.

So, what I've done is added my custom code in edit.Toolbar.js to create node automatically.

That code is working fine in libs but can't make the change directly there.

So, could you suggest me any other way or any hotfix available for this one?

Thanks