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
BedrockMission!

Learn More

View all

Sign in to view all badges

How to include files of one clientlib into another clientlibs?

Avatar

Avatar
Level 1
saurabh_intel
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
saurabh_intel
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
saurabh_intel
Level 1

04-09-2020

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile
Nupur_Jain
MVP

04-09-2020

Hi @saurabh_intel 

 

What I am able to understand is that you want to include one clientlib into another. For this, you will have to use "embed"  feature of clientlibs i.e used to embed code from other libraries. If clinetlibs F embeds clinetlibs G and H, the resulting js and css files included in the html will be a concetration of js and css from clinetlibs G and H.

 

 To embed clientlibs, mention clientlibs name in the "embed" property on your site cq:ClinetlibraryFolder like this:

[cq:ClientLibraryFolder] > sling:Folder
  - dependencies (string) multiple
  - categories (string) multiple
  - embed (string) multiple
  - channels (string) multiple

Also, refer https://docs.adobe.com/content/help/en/experience-manager-65/developing/introduction/clientlibs.html for more details.

 

If this is not not what you want, please elaborate your question in details.

 

Hope it helps!

Thanks

Nupur

Answers (4)

Answers (4)

Avatar

Avatar
Validate 1
MVP
Nikhil-Kumar
MVP

Likes

243 likes

Total Posts

256 posts

Correct Reply

38 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
MVP
Nikhil-Kumar
MVP

Likes

243 likes

Total Posts

256 posts

Correct Reply

38 solutions
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
Nikhil-Kumar
MVP

06-09-2020

@saurabh_intel 

You can use the embed prop to achieve this requirement. 
https://docs.adobe.com/content/help/en/experience-manager-65/developing/introduction/clientlibs.html

Also as you mentioned you want to use some files from one client into another then in that I would suggest to have the common js/css in master clientlib and embed it in clientlib 1 and clientlib 2.

Doing so will fulfill your requirement.

Thanks,
Nikhil

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,357 likes

Total Posts

3,228 posts

Correct Reply

918 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,357 likes

Total Posts

3,228 posts

Correct Reply

918 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

05-09-2020

I would also recommend to use embed feature of clientlibs but technically it is possible to use file of one clientlibs into another.

Example - 

clientlib-site-A is using a.less from clientlib-site-B

 

 

Arun_Patidar_0-1599330638392.png

 

Avatar

Avatar
Boost 50
Employee
surabhikatiyar
Employee

Likes

68 likes

Total Posts

46 posts

Correct Reply

18 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Boost 50
Employee
surabhikatiyar
Employee

Likes

68 likes

Total Posts

46 posts

Correct Reply

18 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 10
View profile
surabhikatiyar
Employee

05-09-2020

In order to include the code of one client library file into another you have two options available:

 

1. Linking the two files: You can link the dependent file to the parent file and for this, you can use the concept of Linking of Dependencies which has been explained in details in the below link:

 

https://docs.adobe.com/content/help/en/experience-manager-65/developing/introduction/clientlibs.html...

 

2. Embed the two files: Or you can embed the code of the dependent file in the parent file and for this please check the below link:

 

https://docs.adobe.com/content/help/en/experience-manager-65/developing/introduction/clientlibs.html...

Avatar

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

136 likes

Total Posts

185 posts

Correct Reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

136 likes

Total Posts

185 posts

Correct Reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile
ArpitVarshney
MVP

04-09-2020

Hi @saurabh_intel 

Why don't you create a common client-lib which include common files and create two clientlibs embedding the common clientlibs?

 

Regards,

Arpit Varshney