We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44427
    • 7 Posts
    I am using modx evo 1.0.2.
    I have resource id. Now i wanted to get a template var of this resource.

    I have array of resource ids. I am getting resource by its id like this:


         $objResource =  $modx->getDocumentObject('id',$arrPage['id']); 




    Now i want to get a template variable of this resource. I have tried like this:

        $objResource->getTemplateVarOutput('TempVarName'); 


    it was not working. What will be the proper way to get tvValue from a specific resource?

    I also tried like this:
    $tv = $modx->getObject('modTemplateVar', $tvId);
    $val = $tv->getValue($resourceId);

    but it is working for revo only.

    Any suggestion will be helpful .

    Thanks