I am trying to implement my own version of WCM's navigation component, whose logic can be found here, subbing my own logic instead:
import java.util.*;
import com.day.cq.wcm.api.Page;
import com.day.cq.wcm.api.PageFilter;
import com.adobe.cq.sightly.WCMUsePojo;
public class Navigation extends WCMUsePojo{
private Iterator<Page> items;
@Override
public void activate() throws Exception {
Page navRootPage = getCurrentPage().getAbsoluteParent(2);
items = navRootPage.listChildren(new PageFilter());
}
public Iterator<Page> getItems() {
return items;
}
}
The HTL, found here, is identical.
I am able to iterate over the first level (at depth 4) of the navigation items. But the loop breaks in item.html
at this line:
<sly data-sly-test="${item.children.size > 0}" data-sly-call="${groupTemplate.group @ items = item.children}"></sly>
Specifically, item.children
does not appear to work even though these are implicit Sling objects. Any thoughts on why this is breaking?
Thanks in advance!