[TYPO3-dev] 4.5 pagetree API to get page uids of all subpages of a page

Stefan Galinski sgalinski at df.eu
Mon Mar 28 18:50:51 CEST 2011


Steffen Müller wrote:

> On 28.03.2011 15:38 Steffen Müller wrote:
>> What's missing here? How do I get childNodes? Does the pagetree API
>> provide such function?
>>
> 
> The classic one: I found the answer myself while asking for it. :)
> 
> $node = t3lib_div::makeInstance('t3lib_tree_pagetree_Node', (array)
> $nodeData);
> $dataProvider =
> t3lib_div::makeInstance('t3lib_tree_pagetree_DataProvider');
> $nodeCollection = $dataProvider->getNodes($node); $pids = array();
> foreach ($nodeCollection as $childNode) {
>          $pids[] = $childNode->getId();
> }
> 
> I hope this is the "official" way.
> 

Hi Steffen,

Your solution looks fine if you just have a single tree level. Otherwise you 
need to collect the pids recursivly as each node inside the node collection 
can have again child nodes.

The transfered tree node has no assigned childNodes after the creation, 
because the calculation would cost too much time if you would do that for 
each single Ext.Direct call.

-- 
Stefan Galinski
staatl. geprüfter Informatiktechniker




More information about the TYPO3-dev mailing list