Replace Body parts with dynamic content

Topics: Writing themes
May 11, 2012 at 9:05 AM

At homepage I have a content-item (page) (default layout), it's rendered in layout.cshtml with code:

@if (Model.Content != null) {
        <div id="content" class="group">
            @Zone(Model.Content)
        </div>
}

At my themes, I overried views: Parts.Common.Body.cshtml. But I dont' replace this code at here because it will effect to another part.

But I want change this content to dynamic content. This means i can load list records from database, and these contents will change when i changed in database. I dont' want to change this content with static content (by HTML editor).

Hope you understand what I explained.

And looking for your help.


Thanks!

Developer
May 12, 2012 at 10:53 AM

It looks like you really need a custom, new part to attach to specific content types. The docs have some samples on that.