Skip to content

Instantly share code, notes, and snippets.

@toodooleedoo
Last active April 21, 2016 13:43
Show Gist options
  • Save toodooleedoo/3357a16ed422d5e336c3 to your computer and use it in GitHub Desktop.
Save toodooleedoo/3357a16ed422d5e336c3 to your computer and use it in GitHub Desktop.
#AEM #SIGHTLY #JAVASCRIPT ACS Commons Generic List get a value
<script type="text/javascript"
data-sly-use.jsutils="../utils.js"
data-sly-text="${jsutils.conf.nativeResource.listChildren[0].value @context='scriptString'}">
</script>
use(function () {
/* Eric Soukenka
*
*
* Provides Sightly with Values from ACS Commons Generic List
* For additional details http://adobe-consulting-services.github.io/acs-aem-commons/features/generic-lists.html
*
*/
var CONST = {
JCR_TITLE: "jcr:title",
ACS_LISTROOT: "/etc/acs-commons/lists/",
JCR_CONTENT: "jcr:content",
JCR_DESCRIPTION: "jcr:description",
LAST_MODIFIED: "cq:lastModified",
PROP_DESIGN_PATH: "cq:designPath"
};
function getACSList(listName) {
return granite.resource.resolve(CONST.ACS_LISTROOT + listName + '/jcr:content/list')
.fail(function (error) {
log.error('Failure in jsutils getACSList exception:' + error)
return '';
})
}
return {
conf: getACSList('listname')
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment