[[!getAssignmentTV? &pid=`[[*id]]`]]
[[!+a.progress]] [[!+a.status]]
if (!empty($pid) && is_numeric($pid)) {
$assignment = $modx->getObject('modResource', $pid);
$modx->setPlaceholder('a.progress', $assignment->getTVValue('assign-progress'));
$modx->setPlaceholder('a.status', $assignment->getTVValue('assign-status'));
}
return;This question has been answered by Bruno17. See the first response.
$assignment->getTVValue('assign-progress')$tv->renderOutput($pid)
$tv->getValue($pid)
<?php
$tvnames = 'assign-progress,assign-status';
$tvnames = explode(',', $tvnames);
if ($tvs = $modx->getCollection('modTemplateVar', array('name:IN' => $tvnames))) {
foreach ($tvs as $tv) {
$tvresource = $modx->getObject('modTemplateVarResource', array('tmplvarid' => $tv->get('id'), 'contentid' => $pid));
$ph = str_replace('assign-','a.',$tv->get('name'));
$modx->setPlaceholder($ph,$tvresource->get('value'));
}
}
$tvresource = $modx->getObject('modTemplateVarResource', array('tmplvarid' => $tv->get('id'), 'contentid' => $pid));
had the same issues.
$assignment->getTVValue('assign-progress')
and also
$tv->renderOutput($pid)
and
$tv->getValue($pid)
seems to cache the value somewhere in the process.