导航组件使用明显 [英] navigation component using sightly

查看:75
本文介绍了导航组件使用明显的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Navigation api来制作全局标头组件@

I am trying to make use of Navigation api for making a global header component @http://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/wcm/foundation/Navigation.html I have a sightly html that is able to get me the reference to the "item"

<div data-sly-unwrap data-sly-use.navitems="${'Helper'}"></div> 
<ul data-sly-list="${navitems.navigationIterator}">
    <li> ${itemList.count} ::  ${item.page.properties.jcr:primaryType} :: ${item.title} 
        ${item.navigation.element.properties.Type}
    </li>

Helper类将返回迭代器,以用作列表并解析itemsList.助手类的方法是这样的:

Helper class is returning the iterator for using as a list and parsing over the itemsList. Helper class method is like this:

public Iterator getNavigationIterator() {
     Navigation nav = new Navigation(getCurrentPage() , absParent , new PageFilter(getRequest()), 3);
     return nav.iterator();
}

我能做什么:

我能够访问页面属性(和任何自定义属性).我能够打印整个树结构

I am able to access the page properties(and any custom properties). I am able to print the entire tree structure

我不知道的地方:

我无法从该项目中检索Navigation.Element.Type属性. 要构建"UL"和"LI"结构,我需要确定所涉及项目的Navigation.Element.Type是什么.

I am unable to retrieve the Navigation.Element.Type property from the item. To make a 'UL' and 'LI' structure, I need to identify what is the Navigation.Element.Type for the item in question.

有人有指针吗?

推荐答案

您尝试过

data-sly-test=${item.listChidlren}

或者简单地

<ul data-sly-list=${currentPage.listChildren}>

这篇关于导航组件使用明显的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆