having multiple ClientLibs set up in the same app. | Community
Skip to main content
Level 4
August 19, 2019
Solved

having multiple ClientLibs set up in the same app.

  • August 19, 2019
  • 3 replies
  • 2907 views

Hello guys, I am a bit familiar with the ClientLibs system but I've never seen this before so I'm curious if this is possible. I am on AEM 6.5 and I'm trying to set up two different ClientLibs on the same project, by this I will be able to configure an editable template by selecting a specific client lib. Do you know any example of this somewhere? I couldn't find any. Mostly I'm interested how the file structure will look like. Thanks.

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 AnkurAhlawat-1

It is not required to be placed under clientlib-site. You can create a parallel client lib by name clientlib-A-site and keep you generic site specific code in clientlib-site and template specific to clientlib-A-site , clientlib-B-site. This is what i prefer, i dont think there is any where any best practice written on how to add another client lib. It is total based on your requirement.

If your code is a sub set of clientlib-site you can also create a clientlib inside clientlib-site but dont add it to js.txt or css.txt of clientlib-site and add this client lib through page policy option.

But its better to get views/suggestion from other community members as well.

3 replies

AnkurAhlawat-1
Level 6
August 19, 2019

Hello,

You can have any number of client libs in your project. If you want to add different client library to different editable templates. Simply create one editable template and go to page policy of template. There you will see an option to add client library to specific template.

Level 4
August 19, 2019

Hey @AnkurAhlawat, thanks for your answer. I understand such a thing is possible, my query is, how to include multiple clientLibs into my project. Under my project I have the following folder structure:

If I am going to add another library, where should that be placed, under the clientlib-site?

I think I'll have to study more about clientLibs.

AnkurAhlawat-1
AnkurAhlawat-1Accepted solution
Level 6
August 19, 2019

It is not required to be placed under clientlib-site. You can create a parallel client lib by name clientlib-A-site and keep you generic site specific code in clientlib-site and template specific to clientlib-A-site , clientlib-B-site. This is what i prefer, i dont think there is any where any best practice written on how to add another client lib. It is total based on your requirement.

If your code is a sub set of clientlib-site you can also create a clientlib inside clientlib-site but dont add it to js.txt or css.txt of clientlib-site and add this client lib through page policy option.

But its better to get views/suggestion from other community members as well.