Skip to content

Instantly share code, notes, and snippets.

@heervisscher
heervisscher / data-sly-set
Created October 10, 2018 06:26
Example of data-sly-set
<div data-sly-set.pagename="${currentPage.title || currentPage.name}">
${pagename}
</div>
This is the gist used for the Adobe Summit labs
L728 (dispatcher intro):
Videos:
ex1 https://www.youtube.com/watch?v=mIlI2T_GXM8
ex2 https://www.youtube.com/watch?v=TtP71cZ3zBo
ex3 https://www.youtube.com/watch?v=Cemp0J34LTM
ex4 https://www.youtube.com/watch?v=s3FeTkMmm-c
<sly data-sly-use.test="test.js" />
<!-- ${test.resourcePath} ${test.title} ${test.title2} -->
test.js
"use strict";
var global = this;
use([], function () {
<!-- https://issues.apache.org/jira/browse/SLING-5813 -->
<sly data-sly-test.linkToPage="${ '{0}/jcr:content' @ format=[ properties.linkTo] }"/>
<sly data-sly-use.linkPage="${ linkToPage }"/>
<h2>${ 'dd-MM-yyyy' @ format=linkPage.cq:lastModified}</h2>
<h2>${ '#.00' @ format=300}</h2>
<!-- https://issues.apache.org/jira/browse/SLING-5632 -->
<a href="${ properties.linkTo @ extension = 'html'}">Link to a page</a>
@heervisscher
heervisscher / gist:17c4678386c13c7d0c4e0de62f661da1
Created March 7, 2017 09:01
HTL example with condition markup
<div data-sly-list="${currentPage.listChildren}">
<sly data-sly-test="${itemList.first}" data-sly-call="${firstDiv}"/>
${item.title}
<sly data-sly-test="${itemList.last}" data-sly-call="${lastDiv}"/>
</div>
https://chrome.google.com/webstore/detail/adobe-marketing-cloud-aem/kcnanncnlkoneeefkpplealnjcpgdkpa
http://adobesummit013-author.adobedemo.com/sites.html/content
mvn install:install-file -Dfile=cq-quickstart-6.2.0-apis.jar
-DgroupId=com.adobe.aem
-DartifactId=uber-jar
-Dversion=6.2.0
-Dclassifier=apis
-Dpackaging=jar