OK, i have figured out how to do this using @EVAL, a snippet called docOptioner and ditto:
1 - Create a snippet called DocOptioner (this grabs the child docs from a specified parent id and outputs them into manager to be selected.
):
<?php
//specify page id you want to get data for
$root = $root;
$depth = $depth;
$exclude = preg_split('~\s*,\s*~', $exclude);
$content = array();
foreach ($modx->getChildIds($root,$depth) as $childID)
{
if (in_array($childID, $exclude))
{
continue;
}
$child = $modx->getTemplateVarOutput(array('menutitle','parent','pagetitle'), $childID);
if ((empty($child['menutitle']) && empty($child['pagetitle'])) || empty($child['parent']))
{
continue;
}
if ($depth > 1)
{
if ($child['parent'] == $root || in_array($child['parent'], $exclude))
{
continue;
}
$parent = $modx->getTemplateVarOutput(array('menutitle'), $child['parent']);
}
$content[] = $child['pagetitle'] . '==' . $childID;
}
return implode('||',$content);
?>
3 - Then Create Template Variable:
Input type: check box
Input option values:
@EVAL return $modx->runSnippet(’docOptionifier’, array(’root’ => 15, ’depth’ => 2, ’exclude’ => "53,333", ’option’ => ’id’));
Note: Update ’root’ => 15 to the id of the your folder.
Depth - you can specify how far down the document tree to search for options.
Exclude - you can exclude certain documents (by id) from being output as option by the snippet.
4 - Associate TV with template
5 - create a ditto call in the template where you want the boxes to appear:
[[Ditto? &documents=`[*name of TV*]` &depth=`1` &tpl=`ChunkNameToFormatOutput` &orderBy=`menuindex ASC`]]
DONE!