We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10449
    • 956 Posts
    You can use Ditto instead. Obviously, it involves a bit more typing... laugh

    e.g.

    [!Ditto? &parents=`47` &display=`all` &total=`1` &tpl=`@CODE [+pagetitle+]` &documents=`50` &seeThruUnpub=`1` &showPublishedOnly=`0` &hidePrivate=`0` &showInMenuOnly=`0`!]

      • 29076
      • 615 Posts
      As far as I can find out GetField doesn’t work with modx 0.9.6.x. Hopefully someone can find time and opportunity to fix that. I’m sorry I can’t. smiley
        I think, thererfor I am! But what I am, and why...?
        • 16610
        • 634 Posts
        Quote from: Sylvaticus at Mar 04, 2009, 02:44 AM

        As far as I can find out GetField doesn’t work with modx 0.9.6.x. Hopefully someone can find time and opportunity to fix that. I’m sorry I can’t. smiley

        GetField works just fine with 0.9.6.x here! I have used it many times with 0.9.6.x (x = 1, 2, 3).
          Mikko Lammi, Owner at Maagit
          • 29076
          • 615 Posts
          OK, great to know, and thanks. laugh Now I know that it’s me doing something wrong and not the snippet. wink
            I think, thererfor I am! But what I am, and why...?
            • 1416
            • 75 Posts
            I´m trying to use this with Ditto.
            What I have is a structure like this:

            Dittocontainer
            |- subcontainer
            |- document1
            |- document2
            |- document3
            |- document4
            |- subcontainer2
            |- document1
            |- document2
            |- document3
            |- document4

            My dittocall is in Dittocontainer, and I need the pagetitle from the parent to the documents.
            I try to fetch it with this call in my ditto template:
            [[GetField? &parent=`[*parent*]` &field=`pagetitle`]]

            But that call only gives me the parent to Dittocontainer, and I´m guessing it is because the ditto call is made from there.

            Is there anyway to get the filed of the child rather then the parent?

            Cheers
            Amrit
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Perhaps [+parent+] would work.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 1416
                • 75 Posts
                Hi Sottwell.

                Naaah. [+parent+] doesn´t yield any results at all... sadly. atleast not with GetField.
                If I use it in my template all it generate is the docid, and that I can do without.

                The problem seems to be that Ditto on the one hand travels down the document tree, fetches all the documents, and returns the information in the document from where the ditto call is made.
                On the other hand when adding the GetField the snippet call fetches all the information from where the snippet call is placed, and returns the info there, which gets the pagetitle from the parent to where I place the call.
                Seems like this solution won´t work...

                Cheers
                  • 36592
                  • 970 Posts
                  [[GetField? &parent=`[*parent*]` &field=`pagetitle`]]

                  This usage seems to be wrong... &parent parameter should have 0 or 1.
                  But &parent parameter does not work properly, when placed in the Ditto template, I believe.

                  In this case it should be something like...
                  [[GetField? &docid=`[+parent+]` &field=`pagetitle`]]

                    • 20557
                    • 43 Posts
                    I am using GetField to replicate the content of a document within another document as follows:
                    [[GetField? &docid=`84` &field=`content`]]


                    However, the replicated page does not seem to be handling the embedded Ditto call within document 84. The replicated page reports "No Documents Found" but the original page works fine.

                    The Ditto call is:
                    [[Ditto?&startId=`84`&level=`1`&sortBy=`menuindex`&sortDir=`ASC`&display=`all`&tpl=`Ditto_Training_Courses_tpl`]]


                    Is there any reason why calling this using GetField would not work?

                    Thanks,
                    Matt

                    EDIT: I changed the Ditto code to:
                    [[Ditto?parents=`84`&depth=`2`&sortBy=`menuindex`&sortDir=`ASC`&display=`all`&tpl=`Ditto_Training_Courses_tpl`]]
                    and it all seems to be working fine!
                      • 27330
                      • 884 Posts
                      [[Ditto? &parents=`84` &depth=`2` &orderBy=`menuindex ASC` &display=`all` &tpl=`Ditto_Training_Courses_tpl`]]