$tv = $modx->resource->getTVValue($tvname);
$options = explode('||', $tv);
foreach ($options as $option){
$params['name'] = $option;
$output = $modx->getChunk($tpl,$params);
}
return $output;This question has been answered by northernape. See the first response.
$tv = $modx->resource->getTVValue($tvname); return $tv;
$tv = $modx->resource->getTVValue($tvname);//get tv value of current resource by name
$options = explode("||", $tv);
$output = '';
foreach ($options as $option){
$params = ['name' => $option];
$output .= $modx->getChunk($tpl,$params);
}
return $output;