Answers.Body: <p>I am doing something similar in using a Structure for the main navigation.  Below is what I have.  Hope it helps!</p>
  <pre><code>{% set menu = craft.entries.section('navMain').all() %}
  &lt;ul&gt; 
  {% nav link in menu %}
      &lt;li&gt;
      {% if link.menuEntry|length %}
          {% if craft.app.request.absoluteUrl ==  link.menuEntry[0].url %}
          &lt;a href=&quot;{{ link.menuEntry[0].url }}&quot; class=&quot;active&quot;&gt;{{ link.title }}&lt;/a&gt;
          {% else %}
              &lt;a href=&quot;{{ link.menuEntry[0].url }}&quot;&gt;{{ link.title }}&lt;/a&gt;
           {% endif %}
      {% else %}
          {% if craft.app.request.absoluteUrl ==  link.menuCustomURL %}
              &lt;a href=&quot;{{ link.menuCustomURL }}&quot; class=&quot;active&quot;&gt;{{ link.title }}&lt;/a&gt;
          {% else %}
              &lt;a href=&quot;{{ link.menuCustomURL }}&quot;&gt;{{ link.title }}&lt;/a&gt;
          {% endif %}
      {% endif %}
      {% ifchildren %}
          &lt;ul&gt;
              {% children %}
          &lt;/ul&gt;
      {% endifchildren %}
      &lt;/li&gt; 
  {% endnav %}
  &lt;/ul&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-29T19:12:55.930Z
Answers.Text: Nevermind, I had somehow removed the parent item. This DOES output the children correctly. Thanks! ---Thanks, this gets the links to output correctly (which I appreciate), but it doesn't structure the children properly (no sub UL for the children).---
Answers.UserDisplayName: doctorgloom
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-28T23:26:13.460Z
Answers.LastActivityDate: 2021-01-28T23:26:13.460Z
Answers.UserDisplayName: Todd
Body: <p>I'd like to build a Structure that can be used to output the main site navigation; each &quot;entry&quot; in the Structure would have three custom fields (types): Category, Entries, URL</p>
  <p><a href="https://craftcms.stackexchange.com/questions/14019/navigation-structure-and-uri-problems">This question is close to what I want</a>, except it's not using Nav; I want children, so I think I need Nav? Plus I couldn't get that code to work anyway.</p>
  <p>Based on <a href="https://craftcms.stackexchange.com/questions/9942/navigation-structure-usage-woes">other questions</a> and the docs, I have this:</p>
  <pre><code>{% set pages = craft.entries.section('navDropDownMenu').all() %}
  &lt;ul&gt;
      {% nav page in pages %}
          &lt;li&gt;
              {% if page.entriesFieldLink %}
                  &lt;a href=&quot;{{ page.entriesFieldLink.first().url|default }}&quot;&gt;{{ page.title }}&lt;/a&gt;
              {% elseif page.urlFieldLink %}
                  &lt;a href=&quot;{{{{ page.urlFieldLink.first().url|default }}&quot;&gt;{{ page.title }}&lt;/a&gt;
              {% else %}
                  &lt;a href=&quot;{{ page.category.url }}&quot;&gt;{{ page.title }}&lt;/a&gt;
           {% endif %}
              {% ifchildren %}
                  &lt;ul&gt;
                      {% children %}
                  &lt;/ul&gt;
              {% endifchildren %}
          &lt;/li&gt;
      {% endnav %}
  &lt;/ul&gt;
  </code></pre>
  <p>The only thing that works here is the Category link, except it should be a child but it isn't. I'm new to Craft so I'm probably doing something basic wrong, but any help is appreciated.</p>
  
Tags: <structure><navigation><custom-fieldtype><custom-field>
Title: Structure Navigation with 3 possible Link Types using Nav tag
ThreadText: # Structure Navigation with 3 possible Link Types using Nav tag
  
  (Asked by: username_0 on 2021-01-28)
  
  I'd like to build a Structure that can be used to output the main site navigation; each "entry" in the Structure would have three custom fields (types): Category, Entries, URL
  
  [This question is close to what I want](https://craftcms.stackexchange.com/questions/14019/navigation-structure-and-uri-problems), except it's not using Nav; I want children, so I think I need Nav? Plus I couldn't get that code to work anyway.
  
  Based on [other questions](https://craftcms.stackexchange.com/questions/9942/navigation-structure-usage-woes) and the docs, I have this:
  
  ```
  {% set pages = craft.entries.section('navDropDownMenu').all() %}
  <ul>
      {% nav page in pages %}
          <li>
              {% if page.entriesFieldLink %}
                  <a href="{{ page.entriesFieldLink.first().url|default }}">{{ page.title }}</a>
              {% elseif page.urlFieldLink %}
                  <a href="{{{{ page.urlFieldLink.first().url|default }}">{{ page.title }}</a>
              {% else %}
                  <a href="{{ page.category.url }}">{{ page.title }}</a>
           {% endif %}
              {% ifchildren %}
                  <ul>
                      {% children %}
                  </ul>
              {% endifchildren %}
          </li>
      {% endnav %}
  </ul>
  
  ```
  
  The only thing that works here is the Category link, except it should be a child but it isn't. I'm new to Craft so I'm probably doing something basic wrong, but any help is appreciated.
  
  **Tags:** structure, navigation, custom-fieldtype, custom-field
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-01-28. Score: 2 | Accepted answer
  
  I am doing something similar in using a Structure for the main navigation. Below is what I have. Hope it helps!
  
  ```
  {% set menu = craft.entries.section('navMain').all() %}
  <ul> 
  {% nav link in menu %}
      <li>
      {% if link.menuEntry|length %}
          {% if craft.app.request.absoluteUrl ==  link.menuEntry[0].url %}
          <a href="{{ link.menuEntry[0].url }}" class="active">{{ link.title }}</a>
          {% else %}
              <a href="{{ link.menuEntry[0].url }}">{{ link.title }}</a>
           {% endif %}
      {% else %}
          {% if craft.app.request.absoluteUrl ==  link.menuCustomURL %}
              <a href="{{ link.menuCustomURL }}" class="active">{{ link.title }}</a>
          {% else %}
              <a href="{{ link.menuCustomURL }}">{{ link.title }}</a>
          {% endif %}
      {% endif %}
      {% ifchildren %}
          <ul>
              {% children %}
          </ul>
      {% endifchildren %}
      </li> 
  {% endnav %}
  </ul>
  
  ```
  
  > **Comments:**
  > **username_0**: Nevermind, I had somehow removed the parent item. This DOES output the children correctly. Thanks! ---Thanks, this gets the links to output correctly (which I appreciate), but it doesn't structure the children properly (no sub UL for the children).---  
  
  ---
  
  