3 Replies Latest reply: Aug 19, 2013 8:09 AM by Satish_Bathala RSS

    Not able to show first level menu in current locale/language

    Wecenter Guru

      Hi All,

      My use case is I have build menu using default Navigation Model where my URL attribute Title came from resource bundle.

      and using following code in template file build a menu.

      but it is showing second level items in Chinese language but first level i.e.Main menu is not coming in Chinese it is showing in english.

      Please check my below code to render menu and let me know any wrong thing i am doing...

       

      
       <c:set var="navNodes"
                                       value="${navigationContext.defaultNavigationModel.listModel['startNode=/, includeStartNode=false']}"
                                       scope="session"/>
                                <ul id="nav" class="scaling-active scaling-ready">
                                 <c:forEach var="menu" varStatus="vs" items="${navNodes}">
                                  <li class="firstset" >
                                  <c:if test="${sessionScope.selectedLanguage eq 'en' }">
                                  <a href="/SampleApp${menu.goLinkPrettyUrl}">
                                    ${menu.title} </a>
                                  </c:if> 
                                     <c:if test="${sessionScope.selectedLanguage eq 'zh' }">
                                     <a href="/SampleApp${menu.goLinkPrettyUrl}">
                                          ${menu.title}       </a>
                                       </c:if>
      
                                   
                                   <c:if test="${not empty menu.children}">
                                    <ul>
                                     <c:forEach var="child" items="#{menu.children}">
                                      <li >
                                       <a href="/SampleApp${child.goLinkPrettyUrl}">
                                       ${child.title}</a>
                                       <c:if test="${not empty child.children}">
                                        <ul>
                                         <c:forEach var="grandchild" items="#{child.children}">
                                          <li >
                                           <a href="/SampleApp${grandchild.goLinkPrettyUrl}">
                                           ${grandchild.title}</a>
                                          </li>
                                         </c:forEach>
                                        </ul>
                                       </c:if>
                                      </li>
                                     </c:forEach>
                                    </ul>
                                   </c:if>
                                  </li>
                                 </c:forEach>
                                </ul>