I cobbled together a quick snippet which aggregates the comments, very basic but it works. Perhaps it can give you a start point.
Create a new snippet with the code below.
Call it in the page uncached ( [! !] )
If you don’t set a &parentid, it uses the currrent document.
Then it figures out the published children, then runs the Jot snippet for each document accordingly.
Your Jot params are set in the $jparams array, it’s easy to figure out the format using the example.
Caveats: Using pagination, there is a set of paging links above and below each section of comments.
<?php
/* jotgroup snippet
[!jotgroup!]
[!jotgroup? &parentid=`` &comlimit=``!]
*/
$output ='';
$parentid = isset($parentid) ? intval($parentid) : $modx->documentIdentifier;
$comlimit = isset($comlimit) ? intval($comlimit) : '2';
$d = "SELECT * FROM ".$modx->getFullTableName( 'site_content' )." WHERE parent='".$parentid."' and published='1'";
$d2 = $modx->db->query($d);
$d3 = $modx->recordCount($d2);
if($d3 > 0){
while($pid = $modx->fetchRow($d2)){
$dj = "SELECT * FROM ".$modx->getFullTableName( 'jot_content' )." WHERE uparent='".$pid['id']."'";
$dj2 = $modx->db->query($dj);
$dj3 = $modx->recordCount($dj2);
if($dj3 > 0){
//$output .='<p><h3><a href="[~'.$pid['id'].'~]">'.$pid['pagetitle'].'</a></h3></p>';
// set up your required Jot params here
$jparams =array(
'action' => 'comments',
'docid' =>$pid['id'],
'pagination' =>$comlimit
);
$output .= $modx->runSnippet('Jot', $jparams);
//$output .='<p><b>'.$dj3.'</b> records found<hr></p>';
}
}
}else{
$output .='<p>nothing found</p>';
}
return $output;
?>
Hope this helps.