Search code examples
modxmodx-revolutionmodx-evolutionwayfinder

MODx Wayfinder &level=2 exclude ALL but one


I am trying to write a Wayfinder call level 2 that excludes ALL level 2 docs except one level 2 doc (id=39) (so ALL level 1 docs have to be included). How to achieve that?

[[Wayfinder? &startId=`0` &level=`2` excludeDocs=`3,4,5,6,7,8,9` &outerTpl=`menu`]]

The best I could come up with was to list ALL level 2 docs to exclude, not very neat solution. Also tried using PHx but no success.


Solution

  • Only other way I can see would be to have 2 wayfinder calls, one for top level, one for level 2 and use &includeDocs.

    Stucture:

    -Resource 1
    -Resource 2
        -Resource 3
        -Resource 4
    -Resource 5
        -Resource 39 (just inc this resource)
    -Resource 7
    

    Level 1 One:

    [[Wayfinder?
    &startId=`0`
    &level=`1`
    &outerTpl=`menu`]]
    

    Level Two:

    [[Wayfinder?
    &startId=`2,5`
    &level=`1`
    &includeDocs=`39`
    &outerTpl=`menu`]]