We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22448
    • 241 Posts
    thanks sharkbait,

    i tried several fields including pagetitle, longtitle, alias and even id to get something to come up. But it’s dead in the water.

    I just downloaded GetField today so i presume it’s the latest version. I also have YAMS and PHx installed. Not sure it that makes a difference.

    Did you see GetField work under MODx 1.0.1?
      • 26931
      • 2,314 Posts
      sorry, try
      [[GetField? &docid=`80` &field=`pagetitle` ]]
      delete the space between [ and "GetField" i just checked, it’s working with Evo 1.0.1
        • 22448
        • 241 Posts
        That did it.
        Thanks Sharkbait, stay safe.
          • 26931
          • 2,314 Posts
          great smiley
            • 22851
            • 805 Posts
            @outre99

            If you are using YAMS then you can use:
            [[YAMS? &get=`data` &from=`pagetitle` &docid=`80`]]

            to grab the pagetitle from a multilingual document. This will display the pagetitle in the correct language. GetField will just grab the standard document variable - which is redundant for multilingual documents when using YAMS.
              YAMS: Yet Another Multilingual Solution for MODx
              YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
              Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
              • 22448
              • 241 Posts
              Thanks PMS,
              i was using the pagetitle just to test GetField. The actual TV is an image and it’s the same for all languages, so no reason to use YAMS for it.

              Thanks Sharkbait. That extra space was the problem. Gotta be more careful.
                • 22851
                • 805 Posts
                Hi again @outre99

                In that case, here is a YAMS placeholder alternative to GetField that you might want to try:

                ((yams_data:docId:tvname))

                This will grab the content of the template variable ’tvname’ from document ’docId’. It may be slightly more efficient than GetField because 1) YAMS doesn’t need to parse and run the GetField snippet and 2) YAMS keeps track of all the data it needs to get from the database and minimises the number of mysql calls required to do so. Therefore, using this construct is likely to reduce the number of mysql calls required (probably by 1). Note that YAMS uses this placeholder internally for obtaining the data required by Wayfinder and Ditto in an efficient manner.
                  YAMS: Yet Another Multilingual Solution for MODx
                  YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                  Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                  • 22448
                  • 241 Posts
                  This is brilliant. Thanks again PMS.
                  I was wondering if something like that was available but didn’t see it in the documentation.

                  I’m loving Yams more and more.
                    • 24075
                    • 83 Posts
                    How can I
                    getField snippet download ??

                    http://modxcms.com/extras/package/?package=173
                    here see i nothing download link

                    ??
                      Petr Püschel, Czech Republic
                      <hr>
                      http://puschpull.org
                      <hr>
                      • 26931
                      • 2,314 Posts
                      How can I
                      getField snippet download ??

                      http://modxcms.com/extras/package/?package=173
                      here see i nothing download link

                      ??
                      link works for me...maybe try another browser?