Vit Kos
Vit Kos

Reputation: 5755

ModX TV parameter doesn't display in snippet

I have created a TV parameter representing a DropDownList Menu. But when I call it in a snippet via Modx API It doesn't display at all.

here's the TV I madeenter image description here

a here is how I call it

$name=$buf['title'].' ( цвет: '.$modx->documentObject['material'].' )';

What am I doing wrong? Thx

Upvotes: 0

Views: 325

Answers (1)

okyanet
okyanet

Reputation: 3146

TVs are not part of the documentObject; I'm a bit rusty on Evo but you'll need to use $modx->getTemplateVar() instead:

$material = $modx->getTemplateVar('material', "", $modx->documentIdentifier);
$name = $buf['title'] . ' ( цвет: ' . $material . ' )';

Upvotes: 1

Related Questions