Hey all,
I am trying to create a file with a ‘OnDocFormSave’ plugin. When I try to run a snippet (getImageList) within my plugin, I realised that any snippets/placeholders within the tpl are not being executed. Only the fields found within the getImageList are executed. Any idea why this is?
<?php
switch ($modx->event->name)
{
case 'OnDocFormSave':
if ($resource->get('template') == 12) {
$ids = array('1','2','3','5');
foreach ($ids as $key => $value){
$vehicles .= $modx->runSnippet('getImageList', array(
"docid" => $value,
"tpl" => "resultsTpl",
"tvname" => "results_details",
"limit" => 0,
"outputSeparator" => ",",
"where" => '{"published:=":"1"}',
)).",";
};
}
break;
}
Tpl
[[!++site_name]] - [[+idx]]: Your result is - [[+result]]
What is returned is
[[!++site_name]] - 1: Your result is - B