<p>This is something i've used, it should work for you, the only downside to it is there being a hardcoded <code>id</code>.</p>

<pre><code>{% set nav = craft.entries.section('yourStructureSection') %}

{% set headerItems = nav.descendantOf(TopMenuId) %}

{% set footerItems = nav.descendantOf(BottomMenuId) %}
</code></pre>

<p>So you would just replace <code>TopMenuId</code> with the entry <code>id</code> of <code>Topmenu</code> and <code>BottomMenuId</code> with the entry id of <code>Bottommenu</code></p>

<p>Then you will be able to loop through each nav :)</p>

<p><strong>Edit</strong></p>

<pre><code>&lt;nav&gt;
 {% nav entry in craft.entries.section('contentPages').descendantOf(13) %} 
    &lt;li&gt; &lt;a href="{{ entry.url }}"&gt;{{ entry.title }} &lt;/a&gt;
        {% ifchildren %}
            &lt;ul&gt; {% children %} &lt;/ul&gt; 
        {% endifchildren %}
    &lt;/li&gt; 
 {% endnav %}
&lt;/nav&gt;
</code></pre>

CC BY-SA 3.0
2015-07-21T13:15:33.403Z
Thanks Alec, good suggestion. I tried this, but didn't work completely. What am i doing wrong? `{% set nav = craft.entries.section('contentPages') %}
   {% set headerItems = nav.descendantOf('topmenu') %}
   <nav>
       <ul>
          {% nav page in headerItems %}
              <li>
                  <a href="{{ page.singleEntrySelector.first().url | default }}">{{ page.title }}</a>
              </li>
             </ul>
            </nav>`
Tom Suter
CC BY-SA 3.0
2015-07-21T13:16:37.967Z
It looks like where you have `topmenu`, this needs to be the numerical `ID` of the entry
Alec Ritson
CC BY-SA 3.0
2015-07-21T13:35:34.830Z
I've updated my answer, it now has code based on your comment above, just a bit of refactoring. I can't see anything wrong with this snippet though? Are you missing an `{% endblock %}` or some other closing tag?
Alec Ritson
CC BY-SA 3.0
2015-07-21T13:45:12.743Z
Awesome, no worries :)
Alec Ritson
CC BY-SA 3.0
2015-07-21T13:01:40.640Z
2015-07-21T13:44:10.433Z
2015-07-21T13:44:10.433Z
Alec Ritson
<p>I want to use one structure section for multiple menu's (navigations). So I want all pages under topmenu in the topmenu (header) and I want all pages in the bottommenu in a menu in the footer. How can I accomplish this most easily in my twig file?
<img src="https://i.sstatic.net/rSTI2.png" alt="example of my structure lay-out"></p>

CC BY-SA 3.0
2015-07-21T12:50:11.903Z
Not really a direct answer to your question, but for specialized menus I prefer using this plugin: https://github.com/am-impact/amnav
peirix
CC BY-SA 3.0
2015-07-22T06:13:39.233Z
Hi Peirix, I know that plugin, but wanted to solve it native with Craft. I didn't want my users to do things on two places (first add content and then add it to a menu-item). Thanks for suggesting though! :-)
Tom Suter
<templating><structure><navigation>
One structure section for multiple menu's (navigations)
# One structure section for multiple menu's (navigations)

(Asked by: username_0 on 2015-07-21)

I want to use one structure section for multiple menu's (navigations). So I want all pages under topmenu in the topmenu (header) and I want all pages in the bottommenu in a menu in the footer. How can I accomplish this most easily in my twig file?
![example of my structure lay-out](https://i.sstatic.net/rSTI2.png)

**Tags:** templating, structure, navigation
> **Comments:**
> **username_1**: Not really a direct answer to your question, but for specialized menus I prefer using this plugin: https://github.com/am-impact/amnav  
> **username_0**: Hi Peirix, I know that plugin, but wanted to solve it native with Craft. I didn't want my users to do things on two places (first add content and then add it to a menu-item). Thanks for suggesting though! :-)  

---

## 1 answers

### Answer by username_2 on 2015-07-21. Score: 1 | Accepted answer

This is something i've used, it should work for you, the only downside to it is there being a hardcoded id.
{% set nav = craft.entries.section('yourStructureSection') %}

{% set headerItems = nav.descendantOf(TopMenuId) %}

{% set footerItems = nav.descendantOf(BottomMenuId) %}

So you would just replace TopMenuId with the entry id of Topmenu and BottomMenuId with the entry id of Bottommenu
Then you will be able to loop through each nav :)
Edit

 {% nav entry in craft.entries.section('contentPages').descendantOf(13) %} 
     {{ entry.title }} 
        {% ifchildren %}
             {% children %}  
        {% endifchildren %}
     
 {% endnav %}

> **Comments:**
> **username_0**: Thanks Alec, good suggestion. I tried this, but didn't work completely. What am i doing wrong? `{% set nav = craft.entries.section('contentPages') %}    {% set headerItems = nav.descendantOf('topmenu') %}    <nav>        <ul>           {% nav page in headerItems %}               <li>                   <a href="{{ page.singleEntrySelector.first().url | default }}">{{ page.title }}</a>               </li>              </ul>             </nav>`  
> **username_2**: It looks like where you have `topmenu`, this needs to be the numerical `ID` of the entry  
> **username_2**: I've updated my answer, it now has code based on your comment above, just a bit of refactoring. I can't see anything wrong with this snippet though? Are you missing an `{% endblock %}` or some other closing tag?  
> **username_2**: Awesome, no worries :)  

---

