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

Avatar

Avatar

mallipanchal

Avatar

mallipanchal

mallipanchal

21-11-2016

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

View Entire Topic

Avatar

Avatar

akashs51893872

Avatar

akashs51893872

akashs51893872

07-08-2018

Hi mallipanchal,

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

1544150_pastedImage_0.png

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

1544151_pastedImage_1.png

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

Good Luck...