Expand my Community achievements bar.

SOLVED

Does it matter whether I name the cq:ClientLibraryFolder folder "Clientlib" or "ClientLib(s)"

Avatar

Level 4

or, whether I locate them at the same level as the custom component, or nest them beneath the component etc., what is the "defacto standard" for experienced AEM developers? When I look throughout the JCR at the existing AEM components, (i.e. those that come with AEM out of the box), I see folders sometimes named Clientlib, and at other times, Clientlibs and I want to be consistent and follow the established defacto standards to ensure that my changes get picked up/detected properly. I doubt this is why my changes aren't picked up immediately sometimes, (as it's probably just typical caching and weird CQ/AEM behavior), but thought I'd ask to be certain I don't cause myself problems going forward.

1 Accepted Solution

Avatar

Correct answer by
Level 8

It does not matter what you name the folder, just as long as it's defined as a ClientLibraryFolder, it'll work.

View solution in original post

7 Replies

Avatar

Correct answer by
Level 8

It does not matter what you name the folder, just as long as it's defined as a ClientLibraryFolder, it'll work.

Avatar

Level 10

Agree with leeasling - most important thing is you use a node type of cq:ClientLibraryFolder and you define the categories property. 

Avatar

Level 4

Thanks so much for the prompt reply gentlemen! I'm guessing that it really doesn't matter where I locate it in the component node hierarchy either, correct? Even so, please share what the defacto standard is for both the name, and where it's located so that I can follow the established norm.

Avatar

Level 8

au4liferz wrote...

Thanks so much for the prompt reply gentlemen! I'm guessing that it really doesn't matter where I locate it in the component node hierarchy either, correct? Even so, please share what the defacto standard is for both the name, and where it's located so that I can follow the established norm.

 

For the name, go with whatever you prefer.  There is no right or wrong.

As far as where the client library can live, you can indeed put them under each component but you need to be careful.  Typically on a dispatcher any request to /apps/ is blocked, meaning that any direct reference to a client library living under apps will result in a 404.  If you do decide to put client libraries with their components, make sure in your main client library defined in your design that you embed the component categories.

Your node (in XML format) would look something like this:

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:ClientLibraryFolder" categories="[apps.projectName]" embed="[apps.projectName.components]"/>

Assuming your component client libraries were named as such, this would embed the component css/js so that it is not referenced from /apps/.

Avatar

Level 10

Lee has pointed out a right thing. 

defacto is that clientlibs can have any name but the node type should be cq:ClientLibraryFolder and

there is no hierarchy to be maintained, once you have categories defined for your client library folder, it can be included in your component. But cautious of having it under apps and it would be better to have it under /etc/designs.

 

regards,

Lokesh

Avatar

Level 4

Thanks again. I'll definitely put it under /etc/designs instead of directly off of the component folder hierarchy, (even though that's what most of the http://helpx.adobe.com tutorials tell you to do).