MODx Revolution getMany Children

The following code allows the retrieval of child document for the page the user is on.

$criteria = $modx->newQuery('modResource');
$criteria->where(array(
'parent' => $modx->resource->get('id'),
'published' => 1,
'deleted' => 0,
));
$criteria->sortby('pagetitle','ASC');
$children = $modx->resource->getMany('Children',$criteria);

foreach($children as $var => $value)
{

}

About Keiron

Web Developer based in the UK. Click here if you want to work with me