can't see anything, why this shouldn't work, then.
How do you call the snippet?
Did you try to place the placholders directly after the snippet-call?
are you trying to get the images from the iterated resources?
Then you will need to pass the resource-id to your snippet and get the TV of that resource.
$values = explode(',',$modx->resource->getTVValue('IMAGE'));
$first = $values[0];
$second = $values[1];
$third = $values[2];
$modx->setPlaceholder('path1',$first);
$modx->setPlaceholder('path2',$second);
$modx->setPlaceholder('path3',$third);
return '';$values = explode(',',$modx->resource->getTVValue('IMAGE'));
$i = 1;
foreach ($values as $value){
$modx->setPlaceholder('path'.$i,$value);
$i++;
}
return '';
<?php
$docid = $modx->getOption('docid',$scriptProperties,$modx->resource->get('id'));
if ($resource = $modx->getObject('modResource',$docid)){
$values = explode(',',$resource->getTVValue('IMAGE'));
$i = 1;
foreach ($values as $value){
$modx->setPlaceholder('path'.$i,$value);
$i++;
}
}
return '';
&docid=`[[+id]]`
<!--?php $docid = $modx--->getOption('docid',$scriptProperties,$modx->resource->get('id')); if ($resource = $modx->getObject('modResource',$docid)){ $values = explode(',',$resource->getTVValue('IMAGE')); $i = 1; foreach ($values as $value){ $modx->setPlaceholder('path'.$i,$value); $i++; } } return '';
and call it with
&docid=`[[+id]]`
<!--?php $docid = $modx--->getOption('docid',$scriptProperties,$modx->resource->get('id')); if ($resource = $modx->getObject('modResource',$docid)){ $values = explode(',',$resource->getTVValue('IMAGE')); $i = 1; foreach ($values as $value){ $modx->setPlaceholder('path'.$i,$value); $i++; } } return '';
and call it with
&docid=`[[+id]]`