Answers.Body: <p>The way I usually accomplish this is to add a "Hide From Nav" Lightswitch field to the sections I want to filter.</p>
  
  <p>This will filter out any entries where the Lightswitch is "on".</p>
  
  <pre><code>{% set subnav = craft.entries.descendantOf(mainEntry).hideFromNav('not 1').level(2) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-14T00:47:31.560Z
Answers.LastActivityDate: 2019-04-14T00:47:31.560Z
Answers.UserDisplayName: Simon Kuran
Body: <p>I have a navigation menu setup but I want to filter out some of the children at level(2) so they aren't showing in the dropdown navigation menu. Here is how I am grabbing the children...</p>
  
  <pre><code>{% set mainEntry = craft.entries.slug(craft.request.getSegment(1)).one() %}
  {% set subnav = craft.entries.descendantOf(mainEntry).level(2) %}
  
  &lt;div class="menu"&gt;
              &lt;ul class="no-list-style"&gt;
                  &lt;li&gt;&lt;a href="{{mainEntry.getUrl}}"&gt;Home&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="javascript:void(0);"&gt;Conference&lt;/a&gt;&lt;i class="fa fa-chevron-down"&gt;&lt;/i&gt;
                      &lt;div class="sub-menu"&gt;
                          &lt;ul class="no-list-style"&gt;
                              {% for page in subnav %}
                              &lt;li&gt;
                                  {{ page.link }} 
                              &lt;/li&gt;
                              {% endfor %}
                          &lt;/ul&gt;
                      &lt;/div&gt;
                  &lt;/li&gt;
               &lt;/ul&gt;
            &lt;/div&gt;
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-12T19:38:36.297Z
Comments.Text: Can you add more details on the filtering? Are you just needing to manually pick entries to hide from the nav?
Comments.UserDisplayName: Simon Kuran
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-13T20:49:57.123Z
Comments.Text: Yes, is there a way to pick which child entries I want to hide?
Comments.UserDisplayName: user9494
Tags: <navigation><descendantof>
Title: How can I filter which children I want to show in a sub navigation menu
ThreadText: # How can I filter which children I want to show in a sub navigation menu
  
  (Asked by: username_0 on 2019-04-11)
  
  I have a navigation menu setup but I want to filter out some of the children at level(2) so they aren't showing in the dropdown navigation menu. Here is how I am grabbing the children...
  
  ```
  {% set mainEntry = craft.entries.slug(craft.request.getSegment(1)).one() %}
  {% set subnav = craft.entries.descendantOf(mainEntry).level(2) %}
  
  <div class="menu">
              <ul class="no-list-style">
                  <li><a href="{{mainEntry.getUrl}}">Home</a></li>
                  <li><a href="javascript:void(0);">Conference</a><i class="fa fa-chevron-down"></i>
                      <div class="sub-menu">
                          <ul class="no-list-style">
                              {% for page in subnav %}
                              <li>
                                  {{ page.link }} 
                              </li>
                              {% endfor %}
                          </ul>
                      </div>
                  </li>
               </ul>
            </div>
  
  ```
  
  **Tags:** navigation, descendantof
  
  > **Comments:**
  > **username_1**: Can you add more details on the filtering? Are you just needing to manually pick entries to hide from the nav?  
  > **username_0**: Yes, is there a way to pick which child entries I want to hide?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-04-14. Score: 2
  
  The way I usually accomplish this is to add a "Hide From Nav" Lightswitch field to the sections I want to filter.
  
  This will filter out any entries where the Lightswitch is "on".
  
  ```
  {% set subnav = craft.entries.descendantOf(mainEntry).hideFromNav('not 1').level(2) %}
  
  ```
  
  
  ---
  
  