Creating Selective Navigation Hierarchy
Problem
You want to create a nav but don’t want to start at the top level. Using the following example section structure, show 2 levels deep inside of Software A (everything that is starred):
Software A
Item 1 **
Item x **
Item y **
Item z **
Item 2 **
Item 3 **
Software B
Item 1
Item 2
etc...
Software C
Solution
{% set topEntry = craft.entries.depth(1).slug('software-a').first() %}
<ul>
{% nav subEntry in topEntry.getDescendants() %}
<li>{{ subEntry.title }}
{% ifchildren %}<ul>{% children %}</ul>{% endifchildren %}
</li>
{% endnav %}
</ul>
Start by grabbing Software A’s entry, however you want to do that, and then passing its descendants into the {% nav %}
tag.
Submitted by Sprocketeer on 1st February, 2017