Use of &level with &limit on pdoMenu or Wayfinder

I seek to limit output of children resources to 10, using either pdoMenu or Wayfinder. After reading Wayfinder’s docs, I thought output could be limited to 10 at each level included within the menu system:

&limit - The limit parameter causes Wayfinder to only process the number of items specified per level.

It seems, however, that &limit limits the total output?

For example, accordinging to the site hierarchy limit=`10` &level=`1` outputs four parent resources. This is expected based on other filters.

However, limit=`10` &level=`2` outputs 10 resources in total - two parent resources (according to sort criteria) and four child resources per parent. With these settings, the second two parents do not appear.

In the second example above, children resources are themselves parents. The final menu system needs one more level, which is where the limit of 10 resources is required. The level (3) contains many resources that are added to daily.

The question is whether it’s possible to apply &limit (or similar) on a per-level basis?

I don’t think so.

Maybe you can use the &includeDocs or the &excludeDocs property to achieve what you want.
Create a custom snippet that generates a comma separated list of resource ids you want to include in your menu or exclude from it.


Or maybe you can use nested Wayfinder calls. Create a custom parent-row-template that calls Wayfinder again with a limit property. But I’m not sure if that even works.


Chunk myParentRowTpl:

<li[[]][[+wf.classes]]><a href="[[]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
1 Like

I don’t know about Wayfinder, but with pdoMenu you can nest by putting a second pdoMenu call in a parent template of your first call. That let’s you have different limits for each level. Probably will need to pay close attention to cached vs uncached…?