I have created a community website using AEM communities and now I need to use dynmaic navigation component which I have instead of the default navigation. I hve added the component as shown below:
<cq:include path="test" resourceType="mycomponents-core/components/dynamic-nav"/>
and in the dynamic-nav.jsp, I have :
<%@page import="com.mycompany.foundation.core.sitemap.NavBuilder"%>
<%@include file="/apps/mycomponents-core/global.jsp"%>
<%
new NavBuilder(pageContext);
request.setAttribute("maxwidth", properties.get("maxwidth", "1330"));
pageContext.setAttribute("sticky", (properties.get("makeSticky", "").equals("true")) ? "ctx-sticky" : "");
pageContext.setAttribute("style", properties.get("style", ""));
pageContext.setAttribute("i18n", i18n);
pageContext.setAttribute("i18nMore", i18n.get("More"));
%>
<div class="dynamic-nav <c:if test='${style ne "vertical" }'>${ sticky }</c:if> ${ style }">
<div class="dn-wrapper" style="max-width: ${ maxwidth }px">
<ul class="nav-level-1">
<c:forEach items="${navigation.navigation}" var="L1item">
<c:choose>
<c:when test="${L1item.parent}">
<c:set var="LI_classes">has-child</c:set>
<c:if test="${L1item.ancestorOfCurrentPage or L1item.currentPage}">
<c:set var="LI_classes">active has-child</c:set>
</c:if>
<li class="${LI_classes}"><a href="javascript:void(0);">
basically, it looping through the items and creating corresponding <li>. when I open the component in edit mode,I need to give the rootPath and it will dynamically creates the menu. Now when I include this in /libs/social/console/components/basepage/basepage.jsp it is only showing the full navigation on the home page ( http://localhost:4502/content/my-community/en.html) and it is not showing anything in the other community pages. How can I make this menu to be visible in all the pages ?