0
votes

I'm looking to implement reusable content blocks in Orchard but can't seem to find any online resources documenting this process.

Orchard has two default parts containers and containable. However, containables can only be assigned to one container.

I've stumbled across a demo of setting up a Content Type of "Books" and another called "Reviews" which uses the containables/container example above. It does not show you how you can relate one review to multiple books.

2

2 Answers

1
votes

Orchard 1.5 now has a content picker field that can be used for this.

1
votes

If you want to get up and running quickly, I'd recommend The Science Project. Building an N-N Relationship has a fairly good example of how to do it yourself.

Personally I like to use an intermediary content item, e.g. BookReview, which would have two content parts - ReviewRelationshipPart and BookRelationshipPart which hold references to their respective content items. You can use the content handler for each of the parts to initialize a lazy loader which loads the content item on demand, e.g. when you call content.As<ReviewRelationshipPart>().Review.