Give this a shot, create a new snippet for this;
<?php
// get the current resource id
$id = $modx->resource->get('id');
// get the resource object
$resource = $modx->getObject('modResource', $docId);
// make sure we have a resource
if($resource){
// see if the resource has children
$hasChildren = $resource->hasChildren();
if($hasChildren){ // pretty sure hasChildren returns 1 or 0
// optionally, retrieve the chunk & populate it.
// replace your-chunk-name and the placeholders with your values.
$output = $modx->getChunk('your-chunk-name',array(
'placeholder-1-name' => 'value',
'placeholder-2-name' => 'value',
'placeholder-3-name' => 'value',
'placeholder-4-name' => 'value',
));
return $output;
}
}
return true;