[TYPO3-dev] getRootLine

Steffen Kamper steffen at dislabs.de
Tue Oct 24 09:40:13 CEST 2006


Hi Masi,

"Martin Kutschker" <Martin.Kutschker at n0spam-blackbox.net> schrieb im 
Newsbeitrag 
news:mailman.1.1161675076.29670.typo3-dev at lists.netfielders.de...
> Steffen Kamper schrieb:
>> Hi,
>>
>> i need for extension all pages from one Rootline. Now I have a problem, 
>> cause there is no way to get them by one SQL.
>> I have to run through all pages and have to decide with the function 
>> getRootLine() if the page is in the wanted rootline.
>
> Hm? The Rootline is consisting of the current page and all its parent 
> pages up to the root of the site.
>
> You can get all page records by doing a "SELECT * FROM pages WHERE uid IN 
> (...)". The IN-part may be created by loopiing through the page uid in the 
> rootline array.
>
> Masi

Yes - then i get the first level. But I need all levels from one rootline ! 
Making a loop in the in-part is exactly what the function getRootLine does - 
in worse case there are 20 queries, and this only for one.
Ok, i can prepare an array for that, this is only example.

Is this not a common thing to optimize DB queries and speeding up Typo3 ? 
Ok, this function mostly needed in BE, but for some cases it's needed in FE 
to, so each Page has Menus to be rendered.

vg Steffen 






More information about the TYPO3-dev mailing list