Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

clientlib include - does not gets added on page until we hit dumplibs.test.html

rohitspathak123
Level 4
Level 4

Hi all,

 

This is for AEM 6.1 . We are using Sightly. This is related to clientlib

 

We have 2 environments - Dev & Test. On Dev its not working and on Test its working fine.

 

We have created a custom clientLib. The category name for this clientLib is same as the category name for OOB clientLib. All we wanted was where ever the OOB clientLib was included then our custom clientLib should also get included. 

 

In our sightly code we will have include for OOB category

<template data-sly-template.include="${@ categories='Client Library categories', mode='optional: JS or CSS, case-insensitve'}"

    data-sly-use.clientlib="${'libs.granite.sightly.templates.ClientLibUseObject' @ categories=categories, mode=mode}">

${clientlib.include @ context='unsafe'}

</template>

 

And this will add OOB JS & my custom JS both on page.

<script type="text/javascript" src="/etc/clientlibs/granite/jquery/granite.js"></script>

<script type="text/javascript" src="/etc/myproject/myclientlib.min.js"></script> 

 

On my TEST environment its working fine and both the JS is getting included.

 

On my DEV environment only OOB JS is getting included.

 

But Now when I try the dumplibs URL 

http://localhost:4502/libs/granite/ui/content/dumplibs.test.html?categories=cq.jquery

 

Then it starts working and I can see my custom JS is getting included.

 

Trying to figure out what can be causing this issue ?

1 Accepted Solution
Amit_Kumar
Correct answer by
Community Advisor
Community Advisor

For your DEV and Test environment you can use and see if you are still getting this problem.

To disable clientlib mechanism, navigate to felix console yourhost:port/system/console/configMgr

Search for "HTML Library Manager" Check "Debug" and save.

anyways for production you will not be changing the client libs so i think it's not a problem

View solution in original post

0 Replies
Lokesh_Shivalingaiah
Community Advisor
Community Advisor

Is it consistent across multiple machines ??

rohitspathak123
Level 4
Level 4

Yes this is consistent across multiple machine.

 

For example:

Machine # 1 : If you hit the page then JS is not included. When u hit the dumplibs url then JS starts appearing on Machine # 1

Machine # 2 : If you hit the page then JS is not included. Eventhough you had hit dumplibs from Machine # 1 still you have to hit this from Machine # 2 browser too to make it work.

Amit_Kumar
Correct answer by
Community Advisor
Community Advisor

For your DEV and Test environment you can use and see if you are still getting this problem.

To disable clientlib mechanism, navigate to felix console yourhost:port/system/console/configMgr

Search for "HTML Library Manager" Check "Debug" and save.

anyways for production you will not be changing the client libs so i think it's not a problem

View solution in original post