S
S
Sergey Miller2020-09-11 01:10:12
MODX
Sergey Miller, 2020-09-11 01:10:12

Modx pdoMenu how to output only the first level?

The menu structure is as follows:

-Document without nesting
-Document without nesting
-Document with 1-level nesting
--nesting

-Document with 1-level nesting
--nesting

-Document with 1-level nesting
--nesting
--nesting

Naturally, the number of documents with nesting and without is unknown.

I need to display all the menu items of the first level, even those that do not have a nesting

pdoMenu use, but probably he can not do this,
&where = `{isFolder=1}` - not suitable, because then the output will only be carried out by parents, which have nesting, but which do not have its figs to you, and not the output.

Can thispdoResources or how to be in such a situation?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danny Arty, 2020-09-11
@blackseabreathe

If you display only the menu of the 1st level, then they probably all have the same parent and most likely it is 0. Then why not do


or via pdoResources with depth=0

S
Sergey Miller, 2020-09-11
@blackseabreathe

It turned out to be done like this:


If this is not entirely correct, please explain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question