load clientLib based on components(CQ.AUTHORING.DIALOG GETS LOADED ON ALL THE PAGES OR ALL THE PROJECTS) | Community
Skip to main content
Level 2
November 22, 2016
Solved

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

  • November 22, 2016
  • 12 replies
  • 14800 views

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.
Best answer by akashs51893872

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
November 14, 2018

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.

arunpatidar
Community Advisor
Community Advisor
November 14, 2018

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

How to Load TouchUI dialog Specific Clientlibs

Arun Patidar