Expand my Community achievements bar.

SOLVED

overlay clientlibs?

Avatar

Level 4

Hi guys,

Does anyone know if it's possible to overlay client libraries?

I have the following structure:

/apps/example/clientlibs[categories="hola"]

/libs/example/clientlibs[categories="hola"]

When I look at the page on the browser both apps and libs clientlibs are included and thus code from both gets executed on client side events.

Any ideas?

Thanks a bunch,

何塞。

1 Accepted Solution

Avatar

Correct answer by
Level 7

HI,

we cannot overlay clientlibs in aem, if you are using same category on more then one folder and using this category name in your jsp:-

/apps/example/clientlibs[categories="hola"]

/libs/example/clientlibs[categories="hola"]

Then it means that all clientlibs which has this category(for ex:-hola) will be loaded.

View solution in original post

3 Replies

Avatar

Administrator

Hi 

Please have a look at overlays documentation,

Link:- https://docs.adobe.com/docs/en/aem/6-2/develop/platform/overlays.html (Configuring the Search Paths)

//The resource Resolver Search Path as defined in the OSGi configuration for the Apache Sling Resource Resolver Factory.
        The top-down order of search paths indicates their respective priorities.
        In a standard installation the primary defaults are /apps, /libs - so the content of /apps has a higher priority than that of /libs (i.e. it overlays it).

The list of absolute path prefixes applied to find resources whose path is just specified with a relative path. The default value is [ "/apps", "/libs" ]. If an empty path is specified a single entry path of [ "/" ] is assumed. (resource.resolver.searchpath)

For  Client libs,

You can try..

1) Create your own client library "mylib" in /etc/designs or /etc/clientlib

2) Embed all required client libs

3) Add the <cq:includeClientLib categories="mylib" /> at the beginning of

the page rendering process.

4) Check the generated HTML for inclusion of clientlibs. If there are more

clientlibs loaded as this "mylib", modify your embed definition and go to step 2.

~kautuk



Kautuk Sahni

Avatar

Correct answer by
Level 7

HI,

we cannot overlay clientlibs in aem, if you are using same category on more then one folder and using this category name in your jsp:-

/apps/example/clientlibs[categories="hola"]

/libs/example/clientlibs[categories="hola"]

Then it means that all clientlibs which has this category(for ex:-hola) will be loaded.

Avatar

Level 4

awesome, good to know, thanks! smiley