We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30585
    • 833 Posts
    Hey guys,

    I’ve searched the forum but couldn’t find anything close to what I’m looking for and I’m hoping to get some help from the seasoned MODx folks.

    I’ using Wayfinder for the first time since I’ve been developing with MODx (yeah, no kidding) and I wanna be able to only display pages that are related to the active page based on a parent-child relationship.

    Say I have an "about-bill.html" directory in which are the following pages "melinda.html"; "buffet.html"; "jobs.html" and so on.

    If a user is viewing any of the pages mentioned, including the "about-bill.html", the side menu should only display links the all other pages in the directory, including the parent.

    This should change from directory to directory and when the parent directoty is the root, only the main folders should be displayed, not their children.

    I hope I’m making sense.

    Thanks
      A MODx Fanatic
      • 34193
      • 330 Posts
      I would do this by using the following structure

      Home 1
      about-bill 2
      melinda 3
      buffet 4
      jobs 5
      second-option 6
      page1 7
      page2 8
      page3 9

      in the home page I would have a wayfinder call as [[Wayfinder? &startId=`0` &level=`1`]] this should only display the top level items (home, about-bill, second-option, etc..)

      Then in about-bill and it’s subs the call would be [[Wayfinder? &startId=`2`]]
      and in second-option and it’s subs [[Wayfinder? &startId=`6`]]

      I think there is an option for working out the parent and using that as the startId but I haven’t used EVO in a while since I only do the occasional site (as a side line) and am playing around with REVO whilst I don’t have any web work on, and I don’t use wayfinder in there.


      EDIT ok just realised that won’t get you all the way there as it won’t display the parent for each section only the subs, but it gives you a starting point.

      EDIT 2 Replacing startId=` ` with startId=`[[UltimateParent? &topLevel=`1`]]` I think will mean that the wayfinder does not have to be hardcoded at each level.
        • 30585
        • 833 Posts
        Super, the EDIT 2 did the trick. The author of Wayfinder should include this example on his website

        Thanks a lot man. This will allow me to spend time on a more productive gound.
          A MODx Fanatic
          • 34193
          • 330 Posts
          Glad to be of help, I’ve had plenty from these forums, and always happy when I can give back.