Dear MODx community,
I have been wondering for 3 hours why oh why my Doodles snippet code that I have saved under Snippets in the Manager won’t take a custom chunk.
This is the default Doodles snippet code that sets the chunk:
/* setup default properties */
$tpl = $modx->getOption(’tpl’,$scriptProperties,’rowTpl’);
Now I want to set another chunkname, I tried:
/* setup default properties */
$tpl = $modx->getOption('tpl',$scriptProperties,'myRowTpl'); - no effect, it defaults back to the rowTpl (why???)
Looking at another module where they used:
/* setup default properties */
$tpl = $modx->getOption('myTpl',$scriptProperties,false); - also no effect, it defaults back to the rowTpl (why???)
I kinda worked around it by giving my chunk name later in at the iterate point in the snippet but I still want to know what goes wrong where and why.
/* iterate */
$output = '';
foreach ($brands as $brand) {
$output .= $bcon->getChunk(myTpl,$brand->toArray());
}
I’m so stuck on this and some help would be so appreciated!