I am new to ModX. I have resources nested in one another like this:
resource1
- resource1-child1
- resource1-child2
resource2
- resource2-child1
- resource2-child2
and this code:
[[!getResources?
&includeContent=`1`
&parents=`[[pdoField?
&id=`[[*id]]`
&field=`id`
&topLevel=`4`]]`
&resources=`-[[*id]]`
&includeTVs=`1`
&processTVs=`1`
&sortby=`menuindex`
&sortdir=`asc`
&depth=`10`
&limit=`100`
&tpl=`allDoctors`
&where=`{"template:=":104}`]]
But for some reason it does not sort elements by menuindex. It looks like it doesn't sort anything at all unless I extract the children out of parent resources. How can I make it sort everything by folders menu index and then children menuindex? Thanks in advance
Found solution myself here by creating a snippet named getResourcesTree
and sorted out like this: