Expand my Community achievements bar.

SOLVED

Load client libs with selection button

Avatar

Level 3

Hi,

I have created a button for which I would like to get loaded some js from clientlibs folder.
The clientlibs folder is created with some categories andcq:ClientLibraryFolder jcr:primaryType (screenshot 1) and containing the script universaleditor.js. The button "universaleditor" has the child "items" containing the node "clientlibs" with the categories of the clientlibs folder and sling:resourceType granite/ui/components/coral/foundation/includeclientlibs (screenshot 2).
The js from the client library folder is not loading in AEM when displaying the universaleditor button.
Can you please suggest why loading of js might fail?

Thanks,
Peter

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi @kautuk_sahni ,

yes, it is working at the end. I had 2 issues:
- missing js.txt file as suggested by @arunpatidar , thanks a lot for that

- the clientlib's category needed to be referred in the .content.xml's 

<jcr:content>

  <head>

     <clientlibs ..

tag, instead of adding it under the selection button clientlib tag (how I found it in some post it could work but it did not).
Js is loading now and I can use it for my purposes.

Thanks,
Peter

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @pnagy 
You are missing js.tx file where you need to add universaleditor.js path

 

More info : https://medium.com/@toimrank/aem-clientlibs-css-and-js-6fda52c4e26f 



Arun Patidar

Avatar

Level 3

Hi @arunpatidar ,

right, I re-tried with js.txt but I still miss something.
I double check it.

Thanks,
Peter

Avatar

Administrator

@pnagy Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Correct answer by
Level 3

Hi @kautuk_sahni ,

yes, it is working at the end. I had 2 issues:
- missing js.txt file as suggested by @arunpatidar , thanks a lot for that

- the clientlib's category needed to be referred in the .content.xml's 

<jcr:content>

  <head>

     <clientlibs ..

tag, instead of adding it under the selection button clientlib tag (how I found it in some post it could work but it did not).
Js is loading now and I can use it for my purposes.

Thanks,
Peter