We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18830
    • 161 Posts
    I’m working at a website with two kinds of menues using wayfinder.

    The structure of the doucument tree is looking like this

    -Parent1
    -Parent2
    --Child1 of P2
    --Child2 of P2
    ---Grandchild1 of P2
    -Parent 3
    --Child 1 of P3

    and so on.

    There is a main navigation at the homepage and on top of every page which shows only the Parents. No Problem at all.

    But when parent2 or any of is children or grandchildren is active I need the parent’s 2 ID to show the right part of the menue.

    I’m struggling for some hours with modx->getParent, $modx->documentIdentifier, $modx->getActiveChildren, FirstChildRedirect and even tried Sottwell’s http://modxcms.com/forums/index.php/topic,6238.msg44510.html#msg44510"" target="_blank" rel="nofollow">@inherit-advice but couldn’t made it out.

    It’s is a costumer’s Website with a lot of non-nerd co-workers and I’m afraid the site would become a mess if the team has to struggle with too many parameters and/or templates.

    Thank you
      • 7923
      • 4,213 Posts
      the UltimateParent snippet always returns that top level parent.. Search in the forums for version 2 (done by OpenGeek), it doesn’t do any database queries..


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 18830
        • 161 Posts
        Hi, doze, it works.

        If anybody else want to use the UltimateParent 2.0 here is the link.

        By the way: [[Wayfinder startId=`[[UltimateParent]]`]] will produce a MySQl error message. [!Wayfinder startId=`[[UltimateParent]]`!] will do.