Jump to main content Jump to doc navigation


Gets all of the child resource ids for a given resource.


API Doc: http://api.modx.com/revolution/2.2/db_core_model_modx_modx.class.html#%5CmodX::getChildIds()

array getChildIds ([integer $id = null], [integer $depth = 10], [array $options = array()])


Get all the children IDs for the Resource 23. Limit to 6 levels deep. Only in the web context.

$array_ids = $modx->getChildIds(23,6,array('context' => 'web'));

Note that when using this method in the manager (to collect input options for a TV for example), you need to define the context with the third options parameter as it defaults to the current context (in that scenario the manager).

See Also