Hi,
I know this is a really old thread but I have a very similar problem and I am pretty lost when it comes to the getTemplateVarOutput equivalent in revo as well.
For my multi-language sites I have a parent document per language that houses some translations and config IDs, in Evo I used a snippet that called ultimateParent, went up the tree to the parent doc, got all the TVs put them in an array and made them accesible using a placeholder. That way if I wanted to call something like "Book now" for a button and have it work in all languages I just added
into my template/chunk where the name of the TV is "bookNow" and it has been translated in the language parent file.
This is the snippet I used before:
$parent = $modx->runSnippet("UltimateParent");
$configTVs = $modx->getTemplateVarOutput('*', $id=$parent, $published=1);
foreach($configTVs as $key => $value) {
$modx->setPlaceholder('translate.'.$key, $value);
}
and it works great, now in Revo I am trying to get it to work and this is what I have so far:
function getConfigTvs($docid, $published) {
global $modx;
$parent = $modx->runSnippet('UltimateParent', array('topLevel' => '1'));
$tvs = array();
$resource = $modx->getObject('modResource',array('published' => $published,'id' => $parent));
$tvs = $resource->getMany('TemplateVars');
foreach($tvs as $tv) {
$key = $tv->getValue($id);
$value = $tv->renderOutput($id);
$modx->setPlaceholder('translate.'.$key, $value);
}
}
and trying to call it in the template or chunks like this:
but no result, no error or blank page either, just no output. I am pretty terrible at PHP and quite new to Revo so go easy on me please