We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14352
    • 9 Posts
    Hello fellow MODx users,

    Today ive started using MODx for realising a website-project i was asked to do.

    So far so good, its not very hard to learn!

    But i’ve spend over an hour trying to realise the following. I guess the solution should be pretty simple, but i cant figure out how..
    This is what I want:

    Lets say this is my menu structure
    page1
    page2
     +sub1_page2
     +sub2_page2
     +sub3_page2
    page3
    page4
     +sub1_page4
     +sub2_page4
    


    Nothing special, ull get the idea: subpages and its parent pages.

    What i want is letting the sub-menu items appear on a different location (different layer), but only the sub menu items of its parent page of course.
    So lets say we go to page2, i want a new layer with the submenu items of page2
    Same when i go to page4, i want a list of submenu items of page4.

    Sounds simple, should be imho.

    I was thinking something like
    [[Wayfinder? &startId=`[*id*]`&level=`2` &outerClass=`nav`&innerClass=`subnav`]]

    wich works if you are at the parent page, but when u go to the subpage, the ID is different and there is no submenu ofcourse..

    or this
    [[Wayfinder? &startId=`[*parent*]`&level=`2` &outerClass=`nav`&innerClass=`subnav`]]

    But itll only show parents..

    I also tried giving different class names to submenus&parents (&parentClass, &levelClass etc) and then trying to hide the irrelevant items with CSS, but no luck either..

    It drives me crazy, no luck on google or the forums either undecided

    Does any of you guys have a simple solution for it?

    Thank you very much in advance!
      • 16183
      • 1,390 Posts
      If I understand you correctly it seems you can use the snippet ultimate parent for this. It is pre-installed with modx (I think?)

      Anyway, here’s some links to posts where what you want is explained in detail...

      http://modxcms.com/forums/index.php/topic,19305.msg120118.html#msg120118
      http://modxcms.com/forums/index.php/topic,24371.msg149928.html#msg149928
      http://modxcms.com/forums/index.php/topic,28043.msg170401.html#msg170401
      http://modxcms.com/forums/index.php/topic,12569.msg83340.html#msg83340

      cheers/k
        • 14352
        • 9 Posts
        Thank you for that mate, didnt know about that snippet yet, ill try it out..

        [edit]

        This did the trick for me for those who wondered:
        [[Wayfinder? &startId=`[[UltimateParent?]]`&level=`1`&outerClass=`submenu_item`]]