简体   繁体   English

Wayfinder:使用Wayfinder显示“在”另一个资源“之下”的资源

[英]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. 我用Wayfinder回忆起它们,现在我想在侧栏中以“树”结构显示它们。

For example for the Resource AVB(39) I have 2 under resources: "RESOURCE UNDER RESOURCE AVB #1" and "RESOURCE UNDER RESOURCE AVB #2". 例如,对于资源AVB(39),我在资源下有2个:“资源AVB#1下的资源”和“资源AVB#2下的资源”。

How can I display them in a "Tree" structure? 如何在“树”结构中显示它们? Something Like 就像是

AVB AVB

  • RESOURCE UNDER RESOURCE AVB #1 资源AVB#1下的资源
  • RESOURCE UNDER RESOURCE AVB #2 资源AVB#2下的资源

This is my actual code: 这是我的实际代码:

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

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. 或者,如果您的层数很深,那么请查看UltimateParent片段,这将使您获得一定的水平。 https://modx.com/extras/package/ultimateparent https://modx.com/extras/package/ultimateparent

For example 例如

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

您可能需要像这样未缓存地运行UltimateParent: [[!UltimateParent]]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM