[TYPO3-mvc] Retrieving all items assigned to a hierarchy for a given entry point

Jochen Rau jochen.rau at typoplanet.de
Sat Jan 30 07:16:43 CET 2010


Hi Thomas.

On 29.01.10 23:38, Thomas "Thasmo" Deinhamer wrote:
> Now I'd like to fetch all items under page '2',
> items 1-6 should get returned.
>
> Is there an easy way doing this the Extbase way,

There is no API function out of the box.

> or do I need to loop through all pages and get the items?

Yes. The logic can reside in the Page object.

$page->getSubcontent();

Or you might want to say

$subpages = $page->getSubpages();

and ask the ItemsRepository

$itemsRepositroy->getAllOnPages($subpages);

Maybe Lazy Loading of items saves your day.

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list