Created
November 16, 2010 17:18
-
-
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/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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