How do I access the properties of a data-sly-list item in Sightly?

牧云@^-^@ 提交于 2019-12-08 09:19:24
Alexander Klimetschek

The child is a Resource which does not have getProperties() but has getValueMap(), so you should use:

${child.valueMap.jcr:title || 'no title'}

Note 1: Colons are allowed in variable names to support typical JCR names like jcr:title.

Note 2: getValueMap() is only available since Sling API 2.7.0 bundle, previously only resource.adaptTo(ValueMap.class) was possible, which the expression language in sightly does not support, and this workaround was required: AEM 6.0 Sightly Child Nodes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!