[TYPO3-mvc] Respect storage page ignored on object properties

Franz Koch typo3.RemoveForMessage at elements-net.de
Sat May 29 16:02:19 CEST 2010


Hey Thomas,

> sorry, but I don't understand what you're refering to here.
> I have a template like this:
>
> <f:for each="{categories}" as="category">
> <h1>{category.title}</h1>
> <f:for each="{category.products}" as="product">
> <h2>{product.title}</h2>
> </f:for>
> </f:for>
>
> So in this case all products are listed for each category, but obviously
> not only products on the specified storage page, but instead all
> products assigned to the category.
>
> I'm not sure how to use a repository for the products directly instead,
> for building the template like above.

I think I'd add a "getAvailableProducts" method (or however you name it) 
to my category model and inside that method I'd call a product service 
that itself is triggering a query in a repository 
($this->productService->findRestrictedByCategory($this)).

That way, you have a) still access to all related categories if you need 
them, and b) the result you need.

Something like that I think.
-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list