Jump to main content Jump to doc navigation

modX::getChildIds

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

Syntax

API Doc: modX::getChildIds()

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

Example

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

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Dannevang Digital
  • Sepia River Studios
  • CrewMark
  • Chris Fickling
  • deJaya
  • Lefthandmedia
  • Murray Wood
  • eydolan
  • Following Sea
  • Anton Tarasov
  • Stéphane Jäggi
  • Raffy
  • Snow Creative
  • A. Moreno
  • Nick Clark
  • JT Skaggs
  • Helen
  • YJ
  • krisznet
  • Richard
  • Yanni

Budget

$301 per month—let's make that $500!

Learn more