[TYPO3-mvc] Respect storage page ignored on object properties
Thomas "Thasmo" Deinhamer
thasmo at gmail.com
Sat May 29 15:04:19 CEST 2010
Am 29.05.2010 09:57, schrieb Jochen Rau:
> Whether product is assigned to a category or not should be explicitly
> defined through your model. I propose to do it the other way around: the
> Product holds references to the Categories it is assigned to. You could
> query for Products that are assigned to a specific Category by saying:
>
> $query->matching($query->contains('categories', $myCategory));
>
> I hope that clarified the PID topic a little bit. We should definitely
> address this topic in the documentation.
>
> Regards
> Jochen
Hello Jochen,
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.
It would be really nice if you could provide some code or a little
example how it's possible with your proposal - I'm a bit confused now.
Thanks a lot Jochen,
Thomas
More information about the TYPO3-project-typo3v4mvc
mailing list