Jahia DX > tree navigation

0 (0 Good)
0 (0 Bad)

tree navigation

by  obayok »  2012/09/07 09:16

Hi all, i have one quiestion and i would ask help.

I need to create tree navigation like this http://jquery.bassistance.de/treeview/demo/?2  sample2

In my jsp file i have this code:

<script type="text/javascript">
    $(document).ready(function() {
            persist: "location", collapsed: true, unique: true

<c:set var="pageNode" value="${renderContext.mainResource.node}"/>
<c:set var="nodeTypeForTree" value="${currentNode.properties.nodeType.string}" scope="request"/>
<c:set var="templateForTree" value="${currentNode.properties.templateForLink.string}" scope="request"/>
<ul id="tree${currentNode.identifier}">
    <c:forEach var="node" items="${jcr:getChildrenOfType(pageNode,nodeTypeForTree)}">
        <template:module node="${node}" view="hidden.tree" editable="false"/>

<c:remove var="nodeTypeForTree" scope="request"/>
<c:remove var="templateForTree" scope="request"/>

It is work, but when i click to any item the page is redirect to new page and in the tree i can see just childrens of this page, but i need to see root directory with childen from selected item.




Number of messages  11
Registration date
0 (0 Good)
0 (0 Bad)

Re: tree navigation

by  pap@commaro.com »  2012/09/21 21:51


the problem is that the pageNode variable you take in the c:forEach is the current page and from there you just retrieve its children.

You could use ${currentNode.resolveSite.home} as the pageNode to start with the homePage.

With ${jcr:getMeAndParentsOfType(renderContext.mainResource.node, 'jnt:page')} you get the currently open path.


Benjamin Papez (pap@commaro.com)

Number of messages  220
Registration date
0 (0 Good)
0 (0 Bad)

Re: Re: tree navigation

by  obayok »  2012/10/03 08:34

Sorry, can you write a sample how it should be?


Number of messages  11
Registration date

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page