Monday 07 July 2014 2:31:52 pm - 4 replies
There is a best practice to get the first children node id of a specific node ?
I try to use my $pager result, but it's a big variable to use :/
Monday 07 July 2014 4:22:38 pm
you can have it shorter and at the same time more efficient and robust:
$firstChildrenNodeId = $repository->getLocationService()->loadLocationChildren($locationParent,0,1)->locations->id
loadLocationChildren returns a list of locations. You can limit the number of locations to return. No need to go through contentInfo which may lead you to the wrong location id in case of multiple locations for the same content.
You must be logged in to post messages in this topic!