[TYPO3-mvc] Most correct way to extract data from the DB for a simple categorized listing?

Henrik Møller Rasmussen info at hmrdesign.dk
Tue Apr 13 08:14:18 CEST 2010


Hello,

I'm playing around with extbase/fluid creating a small product catalog, 
and I want to do a simple listing of the products based on category, and 
sorted by date within each category.

Products have a 1:n relationship to categories and a product has a date.

The final list would be something like this:

Category A:
- 13.04.10: Prod. A
- 11.04.10: Prod. B

Category B:
- 12.04.10: Prod. C
- 01.04.10: Prod. D

etc.

In the old pre-extbase/fluid times, I would do a simple DB-call to fetch 
all products sorted by "category,date DESC", and then loop through all 
the products, and render the category each time the category changed.

I have been thinking of how to do this in extbase, and couldn't figure 
out a smart way. I played around with groupedFor, but I'm not quite sure 
that is the way of doing it.

So a little push in the right direction would be great! Thanks.

Thanks for a very nice product and I'm already loving it for small 
quick-and-dirty extensions like simple product listing etc.

Best regards

-Henrik


More information about the TYPO3-project-typo3v4mvc mailing list