Thank you
I wasn't aware of the modTemplateVar object.
Finally i made the script as following:
$tvname = $scriptProperties['tvname'];
$output = "";
$tv = $modx->getObject('modTemplateVar',array('name'=>$tvname));
$elements = $tv->get('elements');
$items = explode('||', $elements);
foreach ($items as $item) {
$output .= "<option>$item</option>";
}
return $output;
Unfortunately, this
$options = $myTV->getInputOptions();
gave me an error but after more searching I found the correct way
The
elements
is the actual column name in
modx_site_tmplvars
, holding all values of specified TV.