AEM provides ClientLibs feature to organize JS and CSS. Clientlibs can be created as
- Approach 1: Place all files under /etc/designs/{project}/clientlibs path.
- Approach 2: Creating clientlibs under each component. Disadvantage with this approach is it increases number of calls to load clientlibs throuhout the page. This doesn't follow best practices as CSS will not be loaded in head section.
- Approach 3: Place clientlibs under /apps/project/.
- Create a new client library under /apps/... with new category. Let's say myapp.all
- Add a embed property and include all modular component library. (firstcomp,secondcomp)
- Add boolean allowProxy = 'true'
- On the headlibs.jsp include the above
- Then the clientlib will then be proxied via there by passing access control set on the clientlib.
- Configure dispatcher.any to allow for /etc.clientlibs/
No comments :
Post a Comment