Skip to content

Instantly share code, notes, and snippets.

@dlh3
Last active January 14, 2016 11:58
Show Gist options
  • Save dlh3/17ff0067cec6376734ed to your computer and use it in GitHub Desktop.
Save dlh3/17ff0067cec6376734ed to your computer and use it in GitHub Desktop.
CQ5 / AEM Snippets
A collection of CQ5 / AEM Snippets.

cq5-toggle-crx

A CQ5/AEM CRXDE-lite Toggle Bookmarklet for Chrome

Dev utility for toggling the current browser tab between CRXDE-lite (focused on the page's jcr:content) and the page in author mode.

javascript:var jcrContent = escape("/jcr:content"), dloc = document.location.toString(), jcrPos = dloc.indexOf(jcrContent); document.location = (dloc.search(/\/crx\/de/) < 0 ? document.location.origin + "/crx/de/index.jsp#" + document.location.pathname.replace(".html", "") + jcrContent : (jcrPos < 0 ? dloc : dloc.substring(0, jcrPos)).replace("/crx/de/index.jsp#", "") + ".html?wcmmode=disabled")

cq5-toggle-wcmmode

A CQ5/AEM WCMMode Toggle Bookmarklet for Chrome

Dev utility for toggling the current browser tab between edit and disabled WCMMode. Preserves all other query params, but strips the content finder.

javascript:document.location = (document.location.href.search(/[?&]wcmmode=disabled/) < 0 ? document.location.href + (document.location.href.indexOf('?') < 0 ? '?' : (document.location.href.search(/\?./) < 0 ? '' : '&')) + 'wcmmode=disabled' : document.location.toString().replace(/wcmmode=disabled&?/, '')).replace('cf#/', '').replace(/[?&]$/, '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment