Posted By

netdoctor on 04/15/10


Tagged

snippet modx


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

kblair


MODx - Get a Template Variable snippet


 / Published in: PHP
 

Returns the value (content) of the template variable you specified in the snippet.

  1. <?php
  2. // function getTemplateVarOutput($idnames= array (), $docid= "", $published= 1)
  3. //$docid defaults to current document ID
  4.  
  5. $myVar = $modx->getTemplateVarOutput(array("yourTVname"),,$published=1);
  6. $output = $myVar['yourTVname'];
  7.  
  8. return $output;
  9. ?>

Report this snippet  

You need to login to post a comment.