We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    Hi all! I’m hoping someone can help me with this? I’m relatively new to ModX and have searched high ’n’ low but with no luck, I’m more of a HTML/CSS person so please don’t flame my post!

    First of all am I using the right snippet to do this?
    I’ve tried GetField with my install and I’m getting nothing. Not even an output with the most simple call. So I tried PHx and installed the phx:parent custom modifier. Using [*id:parent*] I get the parents page title which is perfect - but I also want the parent’s, parent’s (grandparents?) title.

    Any clues?
      • 5340
      • 1,624 Posts
      I recommend you try again GetField.

      Maybe this will work

      [[GetField? &field=`pagetitle` &parent=`1` &parentLevel=`2`]]

      Play with the parentLevel value.


        • 1778
        • 659 Posts
        Maybe the UltimateParent snippet can do the job... have a look at it, it returns the ultimate parent ID of a resource, when you have ID you can easily get the pagetitle...

        Hope this helps
        cheers
          • 34162
          • 1 Posts
          Hi! Thanks for your input:
          @cipa - GetField didn’t work at all sad I believe it may by install.
          @anso - I’ll let you know how I get on.

          Thanks!
            • 5340
            • 1,624 Posts
            You can also try ParentParent. Similar to UltimateParent.
              • 36926
              • 701 Posts
              Quote from: takingbacksunday at Sep 30, 2009, 08:33 AM

              Hi! Thanks for your input:
              @cipa - GetField didn’t work at all sad I believe it may by install.
              @anso - I’ll let you know how I get on.

              Thanks!


              The GetField snippet should return somthing. Check that when you created it, the name has capital G for Get and capital F for Field and you call is the same.

              This will return the ultimate parent.
              [[GetField? &field=`pagetitle` &parent=`1` &parentLevel=`0`]]
              

              and this will return the document parent.
              [[GetField? &field=`pagetitle` &parent=`1` &parentLevel=`1`]]
              


              Could use both together. What exactly do you want it for, as could somthing like breadcrumb do the trick?

              Thanks

              Ben

                • 34162
                • 1 Posts
                Hi Everyone!

                Thanks for your collective inputs - this was a user error and I’ve solved it using GetField:
                [[GetField? &field=`pagetitle` &parent=`1` &parentLevel=`1`]]


                When I installed GetField I left half the code out of the snippet - (must have been tired) DUMB@$$! :’(

                I told you I was a newbie!