This project is read-only.

How to render default shapes for TitlePart & BodyPart in my custom ContentItem shape?

Topics: Customizing Orchard, General, Writing themes
Jun 14, 2014 at 5:11 PM
I have a ContentItem (called 'Reference') with a TitlePart, BodyPart and a lot of custom fields. To get the rendering perfect, I have placed a custom shape (called 'Content-Reference.Detail.cshtml') in my theme.

I know how to access the title and the body in this view, but what if I want to use the default shapes to render these parts?

So I don't want to put...
<h1>@Model.ContentItem.TitlePart.Title</h1> my view, but something like...
How do I do this?
Jun 14, 2014 at 5:58 PM
Edited Jun 14, 2014 at 5:59 PM
Using Placement:
<Match ContentType="Reference" DisplayType="Detail">
  <Place Parts_TitlePart="DummyTitleZone" />
  <Place Parts_BodyPart="DummyBodyZone" />
Then in you view:
The idea is that you move specific parts in new content zones, while they would have been in Content:XYZ they are now to appear in a new zone. And you call Display to render this zone whenever you want.
Jun 15, 2014 at 10:12 AM
Yes, I got it working using
<Match ContentType="Reference" DisplayType="Detail">
    <Place Parts_Title="DummyTitleZone" />
    <Place Parts_Common_Body="DummyBodyZone" />
Thanks, Sebastien!