We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3232
    • 380 Posts
    title said it all Is it possible to get a document tv value of another document then you are currently on?

    Thanks
    Brian
      • 29181
      • 480 Posts
      Check out the resources page for the getField snippet (by grad if I remember rightly)...think it does just what you are looking for.
        Adrian Lawley: www.adrianlawley.com
        • 3232
        • 380 Posts
        I looked into that but it did not work for me.

        everytime i tried to get a tv it threw the following error.

        Fatal error: Call to undefined function: gettv() in /home/canvas/domains/canvasli.com/public_html/dev/manager/includes/document.parser.class.inc.php(748) : eval()’d code on line 292

        It works find when pulling in normal fields just won’t work on tvs

        [[getField? &docid=`364` &field=`FeaturedBlogTitle`]]
          • 11975
          • 2,542 Posts
          Hi,

          Which version of php are you running?
          As far as I remember the getTV is defined at the bottom of the snippet code.
          With older version of php this can be a problem since the function is called before its definition.

          Otherwise you can do the same by using Ditto and &documents params.

          :-)
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 10487 MODX Staff
            • 1,535 Posts
            Yeah, as heliotrope says, it could be the getTV function being in the wrong place - you could try and cut n’ paste the getTV function code to above where it’s first called.
              Garry Nutting
              Senior Developer
              MODX, LLC

              Email: [email protected]
              Twitter: @garryn
              Web: modx.com
              • 3232
              • 380 Posts
              Thanks heliotrope that did the trick. I moved the funtion to the top of the snippet and all is working correctly.

              Thanks
              Brian