Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Collection of AEM Links, Commands & Tips / Cheat Sheet

Web Consoles & Tools

Adobe's Core Components

If you wonder if they're installed in a project, check CRXDE: http://localhost:4502/crx/de/index.jsp#/etc/packages/adobe/cq60 (or a similar folder). It should contain ZIP files from the core release page:

If you use the core image component, make sure that its JavaScript is loaded on the page. Otherwise the image won't show up because of its lazy loading functionality. Example for including the JavaScript:

<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html">
    <sly data-sly-call="${clientlib.js @ categories='core.wcm.components.image.v1'}"/>

CQ Templates

  • Allowed Paths Property (allowedPaths)
  • Allowed Templates Property (cq:allowedTemplates)
  • Allowed Parents Property (allowedParents)
  • Allowed Children Property (allowedChildren)



Create a cq:template node under the cq:Component and populate with default properties or default resource tree

/apps/.../demo/cq:template@cat = "meow"
/apps/.../demo/cq:template@sling:resourceType = ".../demo"


Create a jcr:content node under the cq:Template and populate with default properties or default resource tree

Adobe Experience Manager Links - Front End


HTL (formerly Sightly)

Customizing the Authoring Page (editor.html)





Custom domain on AEM project

Edit hosts file: vi /etc/hosts


Then clear cache and should work immediately: sudo dscacheutil -flushcache

Enable minification

This is helpful to debug production issues where minification is normally enabled. Go to http://localhost:4502/system/console/configMgr and check the "Minify" checkbox for "Adobe Granite HTML Library Manager”

Issues with AEM's built-in YUI Compressor / minifying CSS?

calc(): If whitespace gets removed, change calc(1.5rem + 20px) to calc(1.5rem - -20px)

0s: "transition: all 0.3s ease-in-out 0s;" gets changed to "transition: all 0.3s ease-in-out 0;" and makes the value invalid. Solution: Don't remove " 0s”.

hsla(0,0%,100%,.95); or rgba(255,255,255,.95); gets changed to hsla(0,0,100%,.95); which is an invalid property value. Workaround: Use a not perfectly white RGBA value: rgba(255, 255, 254, 0.95).

Customize preprocessors

See: [Clientlibs Basics]( Preprocessors) Example in .content.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="" xmlns:jcr=""
    // YUI Compressor for CSS Minification and GCC for JS
    cssProcessor: ["default:none", "min:yui"] jsProcessor: ["default:none", "min:gcc;compilationLevel=advanced"]
    // Typescript to Preprocess and Then GCC to Minify and Obfuscate
    jsProcessor: [

Image optimization

AEM seems to use javax.imageio.plugins.jpeg with a compression mode of (int) 2 and whatever quality param you set, defaulting to .80.

Apache Sling

Output Rewriting Pipelines

The Apache Sling Rewriter is a module for rewriting the output generated by a usual Sling rendering process. Some possible use cases include rewriting or checking all links in an HTML page, manipulating the HTML page, or using the generated output as the base for further transformation. An example of further transformation is to use XSLT to transform rendered XML to some output format like HTML or XSL:FO for generating PDF.

Sling Pipes

At this moment, there are 3 types of pipes to consider:

  • "reader" pipes, that will just output a set of resource depending on the input
  • "writer" pipes, that modify the repository, depending on configuration and input
  • "container" pipes, that contains pipes, and whose job is to chain their execution : input is the input of their first pipe, output is the output of the last pipe it contains.

Query Parameters

?wcmmode=( design | disabled | edit | preview )
?debug=(layout | mdev | mdevc )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.