Skip to content

Instantly share code, notes, and snippets.

@rtripault
Created November 16, 2010 17:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtripault/702108 to your computer and use it in GitHub Desktop.
Save rtripault/702108 to your computer and use it in GitHub Desktop.
The following code allows the retrieval of child document for the page the user is on. (source: http://www.unchi.co.uk/2010/11/16/modx-revolution-getmany-children/)
$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)
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment