This question has been answered by BobRay. See the first response.
[[!getImage? &docId=`[[+id]]` ]]
<?php
$tvId = 12; // replace with the id of the image TV
$docId = $modx->getOption('docId', $scriptProperties);
if (empty($docId)) {
$output = 'NO DOC ID';
} else {
$c = array(
'tmplvarid' => $tvId,
'contentid' => $docId
);
$tvr = $modx->getObject('modTemplateVarResource', $c);
if ($tvr !== null) {
$output = $tvr->get('value');
} else {
$output = 'Could not get TemplateVarResource';
}
}
return $output;
<?php
$tvId = 8; // replace with the id of the image TV
$docId = $modx->getOption('docId', $scriptProperties);
if (empty($docId)) {
$output = 'NO DOC ID';
} else {
$c = array(
'tmplvarid' => $tvId,
'contentid' => $docId
);
$tvr = $modx->getObject('modTemplateVarResource', $c);
if ($tvr !== null) {
$output = $tvr->get('value');
} else {
$output = 'Could not get TemplateVarResource';
}
}
return $output;