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

    I am going through all my snippets and updating the deprecated functions. So far it has been pretty straightforward except for one little hangup:

    In one of my snippets I have a call to the deprecated getTemplateVarOutput method like this:

    $vars = $modx->getTemplateVarOutput(array('String'), $id);

    The legacy code summary says "use modTemplateVar->renderOutput() on a collection of modTemplateVar objects" but I'm not sure how to implement this in my context.

    Could anybody help me out?

    Much appreciated.



      • 4172
      • 5,888 Posts
      try this:

      $tv = $modx->getObject('modTemplateVar',array('name'=>'yourTVname'));
      $value = $tv->renderOutput($id);
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!