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

How much of <cq:includeClientLib js="cq.jquery" /> is necessary for user-facing site?

theo_nicolaou
Level 2
Level 2

Hi,

We are including the <cq:includeClientLib js="cq.jquery" /> ClientLibrary in the <head> of our website and (it appears) to be rendering as below in the HTML source:

<!-- in typical AEM setup, is jquery-ui required on Author and/or website? --> <link rel="stylesheet" href="/etc/clientlibs/granite/jquery-ui.css" type="text/css"><link rel="stylesheet" href="/etc/clientlibs/foundation/jquery-ui/themes/default.css" type="text/css"><!-- /granite/jquery.js is fine to include on website --> <script type="text/javascript" src="/etc/clientlibs/granite/jquery.js"></script><!-- in typical AEM setup, are any of the below files required in Author and/or website? --><script type="text/javascript" src="/etc/clientlibs/granite/utils.js"></script><script type="text/javascript" src="/etc/clientlibs/granite/jquery/granite.js"></script><script type="text/javascript" src="/etc/clientlibs/foundation/jquery.js"></script><script type="text/javascript" src="/etc/clientlibs/granite/jquery-ui.js"></script><script type="text/javascript" src="/etc/clientlibs/foundation/jquery-ui.js"></script>

I'm trying to work out if any/all of the above files are really necessary for a user-facing website, or if in fact most are just required for the Author side of AEM. I am hoping somebody can advise, even based on a typical AEM setup, whether the cq.jquery ClientLibrary is usually needed on a user-facing site.
Based on my investigations so far it appears that the vast majority of the files are not needed for our website (apart from /granite/jquery.js). I have noticed that for example, there is a /granite/jquery-ui.js file and a /foundation/jquery-ui.js file - I am wondering if both or any are needed or if they are supposed to only be used in the Author environment.

Hope the above makes sense - I know every website is different but any help/advice would be appreciated.

Thanks very much in advance

Theo

1 Accepted Solution
Ratna_Kumar
Correct answer by
Community Advisor
Community Advisor

Yes Theo - All JS and CSS files in cq.jquery are required only on Author side.

~ Ratna.

View solution in original post

4 Replies
smacdonald2008
Level 10
Level 10

If you only want a specific version of JQuery - you can create your own client lib: 

https://helpx.adobe.com/experience-manager/using/integrating-jquery-framework-cq.html

You are correct in that most of the Granite APIs are used for touch ui on author side - not part of your site that is rendered on Publish. 

theo_nicolaou
Level 2
Level 2

Thanks for your quick reply! So, just to confirm, all JS and CSS files in cq.jquery (apart from /granite/jquery.js) are only required for Author?

Thanks

Theo

Ratna_Kumar
Correct answer by
Community Advisor
Community Advisor

Yes Theo - All JS and CSS files in cq.jquery are required only on Author side.

~ Ratna.

View solution in original post

theo_nicolaou
Level 2
Level 2

Hi,

I have one more question regarding this - do I need to explicitly call the cq.jquery files to be used on Author or are they just built into AEM anyway? For example I could use an if statement to detect Edit or Design mode. Is this necessary?

Thanks

Theo