hi Jonny,
not sure, if it’s pushing your knwoledge, but maybe you start like this:
* assuming, all relevant documents are in one container ore be specified in the snippet call, like &startid= `X,Y,Z`
<?php
// startid can be provided in snippet parameters and a comma separated list
$startid = (isset($startid)) ? $startid : $modx->documentIdentifier;
$sortBy = (isset($sortBy)) ? $sortBy : 'menuindex';
$sortDirection = (isset($sortDirection)) ? $sortDirection : 'ASC';
$parents = array();
if(strpos($startid, ',') !== false) { // if $startid is given check for comma
$parents = explode(',', $startid); // explode list to array
} else {
$parents[] = $startid; // create single-item array
}
$children = array();
foreach($parents as $parent){
$childArr = $modx->getAllChildren($parent, $sortBy, $sortDirection ,'id,pagetitle,longtitle,parent,content,deleted,published');
foreach($childArr as $child){
if(($child['deleted'] == 0 && $child['published'] == 1)){
$children[] = $child;
}
}
}
//sort($children);
if(count($children) > 0){
$output = '';
foreach($children as $child){
$subTV = $modx->getTemplateVarOutput(array("date","location","duration","title"), $child['id'], $published = 1);
$output .= 'PLACE YOUR TABLE OUTPUT HERE';
.....
}
echo $output;
}
?>
your table output is normal HTML, while accessing the TVs like subTV["date"]
for the pulldown-sort-thingys you’ll have to collect the TVs of each first. maybay there is a more elegant way by accessing the DB directly to perform a GROUP or JOIN select...
cheers
rolf