我身邊有使用悅目訪問組件的子節點的問題。我有一個模板,它使用數據狡猾的資源來提取基本的圖像組件,就像這樣。AEM 6.0悅目子節點
<div class="${wcmmode.edit ? 'image-edit image' : 'image'}" data-sly-resource="${ 'heroImage' @ resourceType='/libs/foundation/components/image', appendPath='image', selectors='fileReference' }"> </div>
我想要做的是根據圖像組件是否實際上具有圖像集來更改css類。爲此,我的計劃是訪問圖像組件節點並讀取其文件引用。東西沿線
<h1>${ properties["heroImage"] }</h1>
不幸的是,這是行不通的。我的問題是如何從我的模板訪問heroImage資源的fileReference,將其視爲其子節點。
感謝, 哈利
我不知道這是可能的,但你可以實現一個Java類中此檢查並引用它的數據狡猾-使用。 – Thomas 2014-09-08 07:01:59
又見這個新問題:http://stackoverflow.com/questions/33418480/how-do-i-access-the-properties-of-a-data-sly-list-item-in-sightly – 2015-10-29 17:54:20