Hi
I have a site that has documents with a specific TV used across different templates. Is there a way for me to query through the API to get all values in this TV? Or would I have to traverse through the document tree in finding out the existing of this TV?
I’m guessing somewhat here, but try this:
<?php
$intersects = $modx->getCollection('modTemplateVarResource, array('templvarid'=>$id));
foreach($intersects as $intersect) {
$tv = $modx->getObject('modTemplateVar', $intersect->get('templvarid'));
$output .= <br />'Resource ID: ' . $intersect->get('contentid');
$output .= '<br /'>'Processed TV VALUE: ' . $tv->renderOutput($intersect->get('contentid'));
$output .= '<br /'>'Raw TV VALUE: ' . $tv->getValue($intersect->get('contentid'));
}