We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16357
    • 27 Posts
    I have a menu three levels deep. The three levels are displayed different places on the page, so I call Wayfinder three times to get them where I want them.

    Level 1.a
    Level 1.b (PROJECTS)
    Level 1.c
    Level 1.d
    Level 1.e
    
    Level 2.a (PROJECT CATEGORY)
    Level 2.b (PROJECT CATEGORY)
    Level 2.c (PROJECT CATEGORY)
    
    Level 3.a (PROJECT)
    Level 3.b (PROJECT)
    Level 3.c (PROJECT)
    Level 3.d (PROJECT)
    Level 3.e (PROJECT)
    

    Level 2 in its full is shown at all times as long as you’ve clicked Level 1.b
    Level 3 is Level 2 dependent. Only those belonging under i.e. Level 2.b will be shown.

    Problem a) When I click Level 1.b I want Wayfinder to find the very newest Level 3 document, regardless of which Level 2 it belongs to, and display its content.
    Problem b) When I click a Level 2 link, I want Wayfinder to find the newest Level 3 document belonging to that Level 2 folder and display it’s content.

    I hope somebody understands what I mean and has a solution to fix it smiley
      • 3749
      • 24,544 Posts
      I’m not sure I understand, but maybe this will help. First, Wayfinder won’t "find" anything after the user clicks on a link. Wayfinder is done and out of the picture before the menu appears on the page.

      That means that the link in the menu has to be to the correct document to begin with.

      I think one way to get what you want is to have each link be a separate Wayfinder menu &sortBy=`id` and &sortOrder=`DESC` with &limit=`1` and &level=`1` so it will only return the newest document. That will be inefficient, and possibly slow, but it should work.

      A custom snippet that queries the DB and creates the appropriate link would probably be a better solution.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting