We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22427
    • 793 Posts
    Hi all out there,
    why the snippet UltimateParent for Revo does not any longer support the parameter &topLevel ? It would be really helpful to have it back...
    Regards
    ottogal
      • 3749
      • 24,544 Posts
      Try &top. smiley
        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
        • 22427
        • 793 Posts
        I tried - with irritating results.
        Assume the following tree:
        home                 (1)
           |__main1             (2)
           |    |__sub11           (4)
           |         |__sub111        (8)
           |    |__sub12           (5)
           |__main2             (3)
                |__sub21           (6)
                |__sub22           (7)
        
        All these ressources have been assigned the same template containing this Wayfinder call:
        [[!Wayfinder? &startId=`[[UltimateParent? &top=`3`]]`]]

        Then the output will show:

        - just the own children
        in (2),
        and in the children of (3), that is in (6) and (7).

        - the whole tree
        in (1),(4) and (5) - not being children of (3)

        - sub111 as a child of itself in sub111

        So that’s really a bit confusing.


        At least the following worked to my intention:
        [[!Wayfinder? &startId=`[[UltimateParent? &top=`[[*id]]`]]`]]
        It shows only the own children (and grandchildren ...).

        Kind regards
        ottogal

          • 3749
          • 24,544 Posts
          UP also has an &id parameter which is set to the ID of the current doc if you leave it out.

          It returns the first parent of $id under &top.

          [[UltimateParent? &id=`45` &top=`6`]]
          will find the first parent of resource #45 under resource #6

          If &top == $id, UP returns the current ID

          If it fails to find an acceptable parent, it returns 0 (hence the whole tree).

          At least that’s the theory. I’ve never actually used it for anything in either Evo or Revo. tongue

            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