Skip to main content
Level 2
Nov 22, 2016 3:22 AM UTC
Solved

load clientLib based on components(CQ.AUTHORING.DIALOG GETS LOADED ON ALL THE PAGES OR ALL THE PROJECTS)

we have defined components clientLibs as cq.authoring.dialog, But these js libs will be loaded for all templates(all projects) while authoring the pages.

Can we restrict them based on template or components as these JS may create issue in other AEM projects?

I tried extraClientLibs but its not working properly..

Is there anyway other then overlaying out-of-box components?

Thanks,

Malli

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
akashs51893872
akashs51893872Accepted solution
Level 3
Aug 8, 2018 1:02 AM UTC

Hi mallipanchal,

I solved this problem by inserting two lines of HTL code in the component HTML itself.  PFA the screenshot:

You need to have a clientLibraryFolder created with this category name:

Now, ONLY wherever you have this component, the JS/CSS files for this component will be loaded.

Good Luck...

12 replies

Level 2
Nov 14, 2018 11:27 AM UTC

Any way we can segregate libraries depending upon claasic/touch UI

I want to keep both dialogs types in component, but the libraries (custom.js) need to be seperately called in case of touch UI and other s when I open dialog in classic.

Translate
arunpatidar
Community Advisor
Community Advisor
Nov 14, 2018 1:12 PM UTC

For touch UI dialog specific clientlibs you can add via extraClientlibs property

How to Load TouchUI dialog Specific Clientlibs

Translate
Arun Patidar