Answers.Body: <p>I'm an idiot, i can just do:</p>
  
  <pre><code>&lt;ul&gt;
     {% nav page in blah %}
      &lt;li&gt;
           {% if page.level == 1 %}
              &lt;a href="/{{ section.handle }}#{{ page.slug }}"&gt;{{ page.title }}&lt;/a&gt;
                  {% else %}
                      {{ page.getLink() }}
           {% endif %}
  
           {% ifchildren %}
              &lt;ul&gt;
              &lt;li&gt;&lt;a href="/{{ page.slug }}"&gt;{{ page }}&lt;/a&gt;&lt;/li&gt; -- this is dodgy
                  {% children %}
              &lt;/ul&gt;
           {% endifchildren %}
      &lt;/li&gt;
      {% endnav %}
   &lt;/ul&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-11T18:58:16.870Z
Answers.LastActivityDate: 2016-06-11T18:58:16.870Z
Answers.UserDisplayName: John
Body: <p>I'm using the nav tag to build a menu which works great, but i just want to repeat the parent menu item over to any sub nav. So if there is a sub nav, at the top of the sub navs links, i want the parent url repeated once.</p>
  
  <p>My current code is this</p>
  
  <pre><code> &lt;ul&gt;
     {% nav page in blah %}
      &lt;li&gt;
           {% if page.level == 1 %}
              &lt;a href="/{{ section.handle }}#{{ page.slug }}"&gt;{{ page.title }}&lt;/a&gt;
                  {% else %}
                      {{ page.getLink() }}
           {% endif %}
  
           {% ifchildren %}
              &lt;ul&gt;
                  {% children %}
              &lt;/ul&gt;
           {% endifchildren %}
      &lt;/li&gt;
      {% endnav %}
   &lt;/ul&gt;
  </code></pre>
  
  <p>and i'm looking at doing something like (but i would love it to work obviously)</p>
  
  <pre><code> &lt;ul&gt;
     {% nav page in blah %}
      &lt;li&gt;
           {% if page.level == 1 %}
              &lt;a href="/{{ section.handle }}#{{ page.slug }}"&gt;{{ page.title }}&lt;/a&gt;
                  {% else %}
                      {{ page.getLink() }}
           {% endif %}
  
           {% ifchildren %}
              &lt;ul&gt;
              &lt;li&gt;{{ page.parent.getLink() }}&lt;/li&gt; -- this is dodgy
                  {% children %}
              &lt;/ul&gt;
           {% endifchildren %}
      &lt;/li&gt;
      {% endnav %}
   &lt;/ul&gt;
  </code></pre>
  
Tags: <structure><navigation>
Title: Using the nav tag repeat the parent once in the children
ThreadText: # Using the nav tag repeat the parent once in the children
  
  (Asked by: username_0 on 2016-06-11)
  
  I'm using the nav tag to build a menu which works great, but i just want to repeat the parent menu item over to any sub nav. So if there is a sub nav, at the top of the sub navs links, i want the parent url repeated once.
  
  My current code is this
  
  ```
   <ul>
     {% nav page in blah %}
      <li>
           {% if page.level == 1 %}
              <a href="/{{ section.handle }}#{{ page.slug }}">{{ page.title }}</a>
                  {% else %}
                      {{ page.getLink() }}
           {% endif %}
  
           {% ifchildren %}
              <ul>
                  {% children %}
              </ul>
           {% endifchildren %}
      </li>
      {% endnav %}
   </ul>
  
  ```
  
  and i'm looking at doing something like (but i would love it to work obviously)
  
  ```
   <ul>
     {% nav page in blah %}
      <li>
           {% if page.level == 1 %}
              <a href="/{{ section.handle }}#{{ page.slug }}">{{ page.title }}</a>
                  {% else %}
                      {{ page.getLink() }}
           {% endif %}
  
           {% ifchildren %}
              <ul>
              <li>{{ page.parent.getLink() }}</li> -- this is dodgy
                  {% children %}
              </ul>
           {% endifchildren %}
      </li>
      {% endnav %}
   </ul>
  
  ```
  
  **Tags:** structure, navigation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-06-11. Score: 2
  
  I'm an idiot, i can just do:
  
  ```
  <ul>
     {% nav page in blah %}
      <li>
           {% if page.level == 1 %}
              <a href="/{{ section.handle }}#{{ page.slug }}">{{ page.title }}</a>
                  {% else %}
                      {{ page.getLink() }}
           {% endif %}
  
           {% ifchildren %}
              <ul>
              <li><a href="/{{ page.slug }}">{{ page }}</a></li> -- this is dodgy
                  {% children %}
              </ul>
           {% endifchildren %}
      </li>
      {% endnav %}
   </ul>
  
  ```
  
  
  ---
  
  