<p>You can use <a href="https://verbb.io/craft-plugins/navigation/docs/template-guides/available-variables#craft-navigation-getActiveNode" rel="nofollow noreferrer"><code>craft.navigation.getActiveNode()</code></a> to get the active node, and then to output your nodes, you can use that node as the ancestor.</p>
<pre><code>{% set activeNode = craft.navigation.getActiveNode() %}
{% set nodes = craft.navigation.nodes().descendantOf(activeNode).all() %}
</code></pre>

CC BY-SA 4.0
2024-01-11T23:45:57.777Z
Thank you for pointing me to the solution!
gstewart
CC BY-SA 4.0
2024-01-11T19:31:21.700Z
2024-01-11T19:31:21.700Z
crawf
<p>I am migrating a Craft 2 site to Craft 3 and as part of that need to migrate from the Navee plugin to the Verb Navigation plugin.</p>
<p>The navigation data import worked fine (Thank you Verbb plugin!), but I am running into issues getting the navigation content to show the same output with the available plugin navigation rendering options and queries.</p>
<p>One issue I am running into is for the sidebar navigation I want to display the entire navigation tree of the current top-level ancestor and then highlight the current active node inside of that.</p>
<p>Navee has an option called &quot;startWithAncestorOfActive&quot; that makes that very easy to achieve: <a href="https://github.com/fromtheoutfit/navee/wiki/Parameters#startwithancestorofactive" rel="nofollow noreferrer">https://github.com/fromtheoutfit/navee/wiki/Parameters#startwithancestorofactive</a></p>
<p>I am thinking I need to leverage the &quot;ancestorOf&quot; parameter in my navigation query, but I am not sure how to pass in the currently active node into it to get the top-level ancestor for the current page I am viewing.</p>
<p>Any thoughts?</p>

<navigation>
Migrating from Navee (Craft 2) to Verbb Navigation (Craft 3), updating templates
# Migrating from Navee (Craft 2) to Verbb Navigation (Craft 3), updating templates

(Asked by: username_0 on 2024-01-11)

I am migrating a Craft 2 site to Craft 3 and as part of that need to migrate from the Navee plugin to the Verb Navigation plugin.

The navigation data import worked fine (Thank you Verbb plugin!), but I am running into issues getting the navigation content to show the same output with the available plugin navigation rendering options and queries.

One issue I am running into is for the sidebar navigation I want to display the entire navigation tree of the current top-level ancestor and then highlight the current active node inside of that.

Navee has an option called "startWithAncestorOfActive" that makes that very easy to achieve: <https://github.com/fromtheoutfit/navee/wiki/Parameters#startwithancestorofactive>

I am thinking I need to leverage the "ancestorOf" parameter in my navigation query, but I am not sure how to pass in the currently active node into it to get the top-level ancestor for the current page I am viewing.

Any thoughts?

**Tags:** navigation

---

## 1 answers

### Answer by username_1 on 2024-01-11. Score: 1 | Accepted answer

You can use craft.navigation.getActiveNode() to get the active node, and then to output your nodes, you can use that node as the ancestor.
{% set activeNode = craft.navigation.getActiveNode() %}
{% set nodes = craft.navigation.nodes().descendantOf(activeNode).all() %}

> **Comments:**
> **username_0**: Thank you for pointing me to the solution!  

---

