AEM CHEATSHEET

AEM CHEATSHEET

Debugging

  • WCMMODE
  • ?wcmmode = design (The WCM is in design mode.)
  • ?wcmmode = disabled (The WCM is disabled.)
  • ?wcmmode = edit (The WCM is in edit mode.)
  • ?wcmmode = preview (The WCM is in preview mode.)
  • Debug
  • ?debug = layout (Shows you all details of the components used on your page)
  • ?debug = mdev ( display mobile device info as inline HTML)
  • ?debug = mdevc (display mobile device info as HTML comment)
  • ?debugClientLibs=true (Writes out all Clientlib categories as separate files (check your HTML-source))
  • CTRL+SHIFT+U ( In combination with ?debugClientLibs=true will show you timing information of your page)

Clientlibs

  • create folder clientlibs with these properties (.content.xml):

<?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”

dependencies=””

categories=””

embed=””/>

categories will be the identifier to this clientlib

create css.txt and js.txt

use #base=css/ in the first line of these files to define a base path for file inclusion

  • inlude clientlib with this in your jsp files: <cq:includeClientLib categories=”” />

Link Checker

<a x-cq-linkchecker=”valid” … <a x-cq-linkchecker=”skip” ….

Templates

Order of evaluation:

    • cq:allowedTemplates
    • allowedPaths (deprecated)
    • allowedParents
    • allowedChildren

Start AEM

    • Start AEM with the following commands.
    • If using a GUI file-system explorer, double-click the cq5-author-p4502.jar file.
    • If using the command line, for a 32bit VM type:
    • java -Xmx1024M -jar cq5-author-p4502.jar

Or, for a 64bit VM, type:

    • java -XX:MaxPermSize=256m -Xmx1024M -jar cq5-author-p4502.jar
  • Use a custom script located in the crx quickstart folder, such as start.bat to start AEM.
  • Windows platform start.bat script example

SET CQ_PORT=1234 & ./start.bat

  • Unix platform start script example

CQ_PORT=1234 ./start

Environment variable Description
CQ_PORT TCP port used for stop and status scripts
CQ_HOST Host name
CQ_INTERFACE Interface that this server should listen to
CQ_RUNMODE Runmode(s) separated by comma
CQ_JARFILE Name of the jarfile
CQ_USE_JAAS Use of JAAS (if true)
CQ_JAAS_CONFIG Path of the JAAS configuration
CQ_JVM_OPTS Default JVM options

Sling URL to Script resolution

GET Request: […]/print.a4.html (Resource type of this resource is (“sling\sample”) Matches in order:

    • print/a4.html.jsp
    • print/a4.jsp
    • Print.html.jsp
    • Print.jsp
    • Html.jsp
    • Sample.jsp
    • GET.jsp
    • Wrong: a4.html.jsp – does not include the first selector (print) a4/print.html.jsp – wrong order of selectors

Tags: