We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5915
    • 21 Posts
    Beautiful Add-on. smiley
      • 28651
      • 26 Posts
      Anyone else just not get this thing to work.
      In the exact place on a chunk where I used to have [pagetitle] I know have [[GetField? &docid=`48` &field=`pagetitle`]]
      assumeing the id is the same as the page I’m on shouldn’t at least that much work?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Works for me...are you sure the name of the snippet is GetField, not getField or some other spelling? And that 48 is the correct ID of the document you want?
        [[GetField? &docid=`5` &field=`pagetitle`]]


        Did you install it correctly, with the getfield.inc.php file in the assets/snippets/getfield/ folder?
          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
          • 15029
          • 35 Posts
          That’s a great tool.
          I would like to use the pagetitle instead of the pageID so that the same code can work on different installations where the resource structure is not the same.
          Is there a way to retrieve the ID of a given page title?
            • 22448
            • 241 Posts
            Hi all,

            having an issue with calling GetField from within an PHX modifier.
             [+introtext:limit=`[!GetField? &docid=`2`&field=`panelCutoff`!]`+]


            This works:

             [+introtext:limit=`200`+]

            it returns the first 200 characters of the introtext.

            and this works:

            [!GetField? &docid=`2`&field=`panelCutoff`!]

            it returns the tv value of 200 from the home page.

            But together they don’t work. Limit modifier uses the default 100 characters and ignores the value of the tv.

            Any ideas will be warmly welcomed.
            Tahnks.
              • 26931
              • 2,314 Posts
              Hi outre99,

              having an issue with calling GetField from within an PHX modifier.
              [+introtext:limit=`[!GetField? &docid=`2`&field=`panelCutoff`!]`+]


              try this:
              [+introtext:limit=`[[GetField? &docid=`2` &field=`panelCutoff`]]`+]
                • 22448
                • 241 Posts
                That worked.
                Thanks a million.
                  • 21438
                  • 10 Posts
                  Hi

                  Potentially very useful snippet. However, I have a problem. I want to get the title of an unpublished parent page (ie: I’m using the parent purely as a container - it shouldn’t be published as a page). This doesn’t work - it only works when the container is published. Is this a bug or should I do this a different way?

                  All the best

                  Nick
                    • 22448
                    • 241 Posts
                    Hey all,
                    I’ve used GetField on previous MODx versions. Now i’ve upgraded to 1.0.1 and GetField doesn’t work at all.
                    I’m trying the simple things like
                    [[ GetField? &docid=`80` &field=`title` ]]


                    but nothing comes up at all.
                    Nothing works.

                    Has anybody seen this?
                      • 26931
                      • 2,314 Posts
                      [[ GetField? &docid=`80` &field=`title` ]]

                      but nothing comes up at all.
                      Nothing works.
                      try
                      [[ GetField? &docid=`80` &field=`pagetitle` ]]
                      http://spreadsheets.google.com/pub?key=pHJSI5ye5FxqRfh1nEPCnJA