Solved
Accessing nested properties via sightly
- November 24, 2016
- 4 replies
- 4235 views
Happy Thanksgiving! I shouldn't be working but this issue is driving me nuts and I'd love to figure this out.
I have a use java class that has a method called getPage. The code is below. The idea is to get all the child page underneath the page where this component lives.
public List<Page> getPage() { List<Page> results = new ArrayList<Page>(); Iterator<Page> children = getCurrentPage().listChildren(); while (children.hasNext()) { Page child = children.next(); results.add(child); } return results; }I call it in my component like so
<div class="directory"> <div class="row" data-sly-list.childPage="${comp.page}"> <div class="small-6 medium-3 large-3 columns"> <a href="${childPage.path}"> <img src="#nestedProperty"> <h4>${childPage.title}</h4> </a> </div> </div> </div>tile and path work great, but I'd like to call a nested property. Here's the nested property (slide1FileReference) I'm talking about.
I found some documenation online and tried this but it doesn't work
<img src="${childPage.properties[root/c1_leadspace_carouse/slide1FileReference]}">