Hi
We have a side nav, that should display sub nav pages, as long as those pages are not hidden from navigation.
However it is behaving strangely:
To illustrate:
With one sub item:
With two sub items:
The code looks correct to me :
<div class="navigation__wrapper" > <nav class="navigation"> <ul class="navigation__list--one"> <% // get starting point of navigation long absParent = currentStyle.get("absParent", 2L); String navstart = Text.getAbsoluteParent(currentPage.getPath(), (int) absParent); //if not deep enough take current node if (navstart.equals("")) navstart=currentPage.getPath(); Resource rootRes = slingRequest.getResourceResolver().getResource(navstart); Page rootPage = rootRes == null ? null : rootRes.adaptTo(Page.class); String xs = Doctype.isXHTML(request) ? "/" : ""; if (rootPage != null) { Iterator<Page> children = rootPage.listChildren(new PageFilter(request)); while (children.hasNext()) { Page child = children.next(); %> <li class="navigation__item"> <a href="<%= xssAPI.getValidHref(child.getPath()) %>.html" class="navigation__link"> <span><%= xssAPI.getValidHref(child.getTitle()).replace("%20", " ") %></span> <!-- <span class="icon icon-arrow-right-thick iconproperties"></span> --> <span class="icon nav-right-arrow"></span> </a> <ul class="navigation__list--submenu"> <% Iterator<Page> childChildren = child.listChildren(new PageFilter(request)); while (childChildren.hasNext()) { Page childChildChildren = childChildren.next(); %> <li class="navigation__item"> <a href="<%= xssAPI.getValidHref(childChildChildren.getPath()) %>.html" class="navigation__link"> <span><%= xssAPI.getValidHref(childChildChildren.getTitle()).replace("%20", " ") %></span> <span class="icon nav-right-arrow"></span> </a> </li> <% } %> </ul> </li> <% } } %> </ul> </nav> </div>
Any ideas why it would be behaving in this way?
Solved! Go to Solution.
Views
Replies
Total Likes
Only related doc is this one:
https://docs.adobe.com/docs/en/aem/6-1/develop/the-basics/website.html#Creating the Top Navigation Component
but this is for top nav component.
Views
Replies
Total Likes
Are you following an online doc so we can try and reproduce your results?
Views
Replies
Total Likes
Only related doc is this one:
https://docs.adobe.com/docs/en/aem/6-1/develop/the-basics/website.html#Creating the Top Navigation Component
but this is for top nav component.
Views
Replies
Total Likes
smacdonald2008 wrote...
Only related doc is this one:
https://docs.adobe.com/docs/en/aem/6-1/develop/the-basics/website.html#Creating the Top Navigation Component
but this is for top nav component.
Hi Scott
Thanks for the response, we are actually using the top-nav, it has just been styled to appear as a side navigation.
I will look through the link, thanks very much
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies