I was asked by a member of the MODx-community, if it is possibly to count the children of more than one parent. So I tried to rewrite this snippet. But not being a programmer I need some help:
Thisis how I started:
$parentId = explode(",",$parentId);
foreach ($parentId as $value) {
$child = count($modx->getDocumentChildren($value, 1, 0,'id'));
}
$partentId would be an comma seperated list of parents ID´s from the snippet call.
Now I wanted to have something like
but $child will not return an array but simply the numbers of the children written one after the other without any delimiter.
Any ideas?
Thank you
Mazso