AEM Sites Developer Professional study materials
AEM Sites Developer Professional study resources

AEM Sites Developer Professional: Client-Side Development and Asset Handling

AEM Sites Developer Professional · Work through your exam, one topic at a time.

All guide sections

Client-Side Development and Asset Handling

Clientlibs: categories, dependencies, embeds

CSS/JS are packaged as client libraries (cq:ClientLibraryFolder) with a categories property, plus js.txt/css.txt listing files in order. A consumer includes a category via <sling:include path="..." resourceType="core/wcm/components/page/v3/page/html/clientlibs"> or, classically, data-sly-call with the page's clientlibs template; the page component exposes html libraries (head) and js libraries (body).

Two mechanisms are frequently confused:

  • dependencies - the other categories must load first; they emit their own separate <script>/<link> tags.
  • embed - the other categories' source files are concatenated into this library and no separate tag is emitted.

allowProxy must be true for clientlibs under /apps to be served through /etc.clientlibs, which is mandatory on AEM as a Cloud Service because Dispatcher only allows /etc.clientlibs and /content. Modern projects compile the front end with the ui.frontend module (webpack/npm) and use aem-clientlib-generator to produce the clientlib folder at build time.

Assets

DAM assets are dam:Asset nodes with renditions under jcr:content/renditions; metadata lives in jcr:content/metadata (XMP). The Image/Core Image component serves responsive images via srcset and breakpoints, and AEM can delegate to Dynamic Media/Smart Imaging for crop presets, smart crop and per-request optimised delivery. Processing is driven by asset workflows (e.g. metadata extraction, thumbnail creation), and in Cloud Service processing profiles replace manual workflow launching.

Worked example / rule of thumb: if a library is required before another and must not be a separate request, use embed; if it must be shared and separately cached, use dependencies. And if your styles 404 on publish, check allowProxy and the /etc.clientlibs path first.