fromtheoutfit / navee

Navigation module for Craft CMS
Other
113 stars 6 forks source link

multiple menu issue #30

Open proximo7 opened 7 years ago

proximo7 commented 7 years ago

I have a large menu with complex HTML. Because of how the HTML is structured I had to use multiple configurations and separate nodes. I had hoped to just use one but couldn't find another way.

The problem I'm seeing now is that sometimes all the nodes reset to show the entire menu hierarchy. Other times the menu outputs correctly. Here's a sample of the code:

{% set navConfigPatients = { 'startWithChildrenOfNodeId' : 42827, 'maxDepth' : 3 } %}
{% set navConfigServices = { 'startWithChildrenOfNodeId' : 42853, 'maxDepth' : 2 } %}

<div class="dropdown w-dropdown" data-delay="0">
          <div class="dropdown-nav nav-link w-dropdown-toggle">
                <div>Patients</div>
          </div> 

          <nav class="dropdown-list w-dropdown-list">
              {% set navigation = craft.navee.getNav('main', navConfigPatients) %}    
              {% nav node in navigation %}
                     <a class="dropdown-nav-link w-dropdown-link" href="{{ node.link }}">{{ node.title }}</a>
                    {% ifchildren %}
                        {% children %}
                    {% endifchildren %}
              {% endnav %}
           </nav>   
       </div>  

          <div class="dropdown w-dropdown" data-delay="0">
            <div class="dropdown-nav nav-link w-dropdown-toggle">
              <div>Services</div>
             </div>
            <nav class="dropdown-list w-dropdown-list">
                {% set navigation = craft.navee.getNav('main', navConfigServices) %}    
                {% nav node in navigation %}
                       <a class="dropdown-nav-link w-dropdown-link" href="{{ node.link }}">{{ node.title }}</a>
                      {% ifchildren %}
                          {% children %}
                      {% endifchildren %}
                {% endnav %}
             </nav> 
          </div>

Is there a better way to do this? Is there a way to fix the issue I'm seeing?