/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* Parse all TVs in the [content] of a document. $doc_id is the id of the document */ function mergeDocumentContentX($doc_id) { global $modx; $my_doc = $modx->getTemplateVarOutput('*',$doc_id); $template = $my_doc['content']; $basepath= $modx->config["base_path"] . "manager/includes"; for ($i= 0; $i < $variableCount; $i++) { $key= $matches[1][$i]; $value = $my_doc[$key]; include_once $basepath . "/tmplvars.format.inc.php"; include_once $basepath . "/tmplvars.commands.inc.php"; $w= "100%"; $h= "300"; $value= $modx->getTVDisplayFormat($value[0], $value[1], $value[2], $value[3], $value[4]); } $replace[$i]= $value; } //return $template; return $return_vals; }