Sure - thank you for taking a look. Both snippets and the eval statement in the tv are below.
As I grabbed this code, I noticed that the closing php bracket is not present, though this was included when the snippets were created. I opened up a couple snippets that I brought in via Package Manage and they, too, lack the closing bracket, so I assume this is normal.
Here's getChunks:
<?php
/* Get the category object */
$catObj = $modx->getObject('modCategory',array('category'=>$category));
/* Get the chunk objects in that category */
$chunkArray = $catObj->getMany('Chunks');
$chunkNames=array();
/* Put the chunk names into the array */
foreach($chunkArray as $chunk) {
$chunkNames[] = $chunk->get('name');
}
/* Format the chunk names as a delimited string for the TV */
$l_chunks = implode("||",$chunkNames);
return $l_chunks;
Here's chunkListParser:
<?php
$ar_chunks = explode(',',$chunks);
$ar_chunks = array_unique($ar_chunks);
$output = '';
foreach ($ar_chunks as $chunk) {
if ($chunk != '') {
$c = $modx->getChunk($chunk);
if ($c) $output .= $c;
}
}
if ($output != '' && isset($wrapperdiv)) {
$output = '<div id="'.$wrapperdiv.'">'.$output.'</div>';
}
return $output;
Here's the TV eval statement:
@EVAL return $modx->runSnippet('getChunks',array('category'=>'Image Page - Price Sets'));
Thanks again.