wosom
wosom

Reputation: 11

Wayfinder: Display the Resources that are "under" another Resource with Wayfinder

I am developing a website that has a main navigation on top and then some different navigations in the right sidebar (here).

I am recalling them with Wayfinder and now I would like to display them in "Tree" structure in the sidebar.

For example for the Resource AVB(39) I have 2 under resources: "RESOURCE UNDER RESOURCE AVB #1" and "RESOURCE UNDER RESOURCE AVB #2".

How can I display them in a "Tree" structure? Something Like

AVB

This is my actual code:

[[!Wayfinder? &startId=`5` &level=`0`]]

Upvotes: 1

Views: 124

Answers (2)

Jamison Mergens
Jamison Mergens

Reputation: 37

You may need to run UltimateParent uncached like this: [[!UltimateParent]]

Upvotes: 0

Ben Butler
Ben Butler

Reputation: 1

You could do something like this.

[[Wayfinder? &startId=`[[*parent]]` ]]

Or if you are a few level deep then check out the UltimateParent snippet, which will allow you got a certain amount of levels up. https://modx.com/extras/package/ultimateparent

For example

[[Wayfinder? &startId=`[[UltimateParent? &topLevel=`2`]]` ]]

Upvotes: 0

Related Questions