Closed hduchesne closed 4 years ago
Why not this?
<c:set var="curentPageNode" value="${renderContext.mainResource.node}"/>
I thought about it, but if mainRessource is not a page, we can be in trouble. after we can also do a test...
Please test my pull request #3 or create a new one if needed.
works
I closed this PR; the link for to parent page (site node) does not work. Maybe we should link to the homepage.
Please check if PR #4 fix this issue
<c:set var="curentPageNode" value="${jcr:getMeAndParentsOfType(renderContext.mainResource.node,'jnt:page')}"/>
return an array but is not managed as his.e.g. If I create this hierarchy Page Lvl0 -> Lvl1 -> Lvl2
if I add a navbar in Lvl2 and select currentPage as starting point, curentPageNode is equals to
[node /sites/i8/lvl0/lvl1/lvl2, node /sites/i8/lvl0/lvl1, node /sites/i8/lvl0]
to fix this we have to check if currentPage is not empty and extract the first element