MODx - Get a Template Variable snippet


/ Published in: PHP
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.