Answer the question
In order to leave comments, you need to log in
How to display an empty tv field MODX REVO?
There is a simple snippet that gets the value of the tv fields:
$where = array (
'contentid' => $resourceId, // id ресурса
'tmplvarid' => $variableId // id поля
);
$tv = $modx->getObject('modTemplateVarResource', $where); // получение tv.объекта
$val = $tv->get('value'); // получение значения
return $val;
Answer the question
In order to leave comments, you need to log in
thanks for the idea qork
Rewrote the snippet:
$where = array (
'contentid' => $resourceId, // id ресурса
'tmplvarid' => $variableId // id поля
);
$tv = $modx->getObject('modTemplateVarResource', $where); // получение tv.объекта
if(!$tv) return;
$val = $tv->get('value'); // получение значения
return $val;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question