We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11699
    • 11 Posts
    Hi all,

    Very new to modx and have been playing with ditto.

    What I want to know is can you use ditto to find an articles sibling articles. I know this is possible by specifiying the parent but ideally I would like to do this automatically without knowing the parent id. Is this possible??

    Thanks in advance
      • 5340
      • 1,624 Posts
      Do you want to show all the documents?
        • 11699
        • 11 Posts
        yes all siblings of a particular page
          • 34193
          • 330 Posts
          This should be doable with using the ultimate parent snippet to set the parent of the ditto call, If I remember right you need to set level in the ultimate parent or it goes all the way to the root take a look at the docs for ultimate parent for details.
            • 4172
            • 5,888 Posts
            for children of one document you do it with:

            &parents=`[*id*]` 


            for siblings use

            &parents=`[*parent*]`


            if you want to have another output for the active document you can use phx in your ditto-chunk:

            [+id:is=`[*id*]`:then=`
            this is the output for my active document
            `:else=`
            here comes my siblings output:<h4>[+pagetitle+]</h4>.....................
            `+]

              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!