This project is read-only.

Access contained content items in view of the container

Topics: Core, General
Aug 16, 2013 at 9:44 AM
Hi all,

I want to use Orchard 1.7 for a site discussing books. So I created a new content type for books and a content type for reviews. The book has a container part and reviews containable part. If there are better ways, please advise me, since I am new to Orchard :).

The 'out-of-the-box' presentation is working, e.g. reviews are shown on the book page.

Next, I wanted to change the appearance, so I decided to add an alternate template for the book content type. But from this view I don't know how to access the contained reviews. I tried Shape Tracing, but could not find the reviews. Is this the proper way and how do I access the reviews from my book view?

Thanks in advance,
Aug 26, 2013 at 3:39 PM
I have the same question. Haven't been able to find an answer. Let me know if you do. I'll post here if I figure it out.
Aug 27, 2013 at 8:31 AM
I did not find a solution to access the contained items from my alternate template. Instead, I choose to use to customize the appearance. Additionally, I did use alternate templates to change the appearance of fields (i.e. for displaying images).

btw. I also tried using projections (very powerfull!), where I filtered for the content type (in this case the review), but could not find how to filter for the book currently shown to which the review applies (having a container / containable 'relation')