I have the following zone in my layout file:
@Display(Model.Blog)
I want to always render my blog post list into this zone, so I edited my placement.info file like so:
<Place Parts_Blogs_BlogPost_List="Blog"/>
Parts.Blogs.BlogPost.List.cshtml lives in the Views directory of my theme.
I can't get the blog to render. If change the name of the zone to "Content" it works....
Update
In the placement.info in theroot of my theme directory:
<Place Parts_Blogs_BlogPost_List="/BlogZone"/>
In my layout.cshtml
@if (Model.Content != null) {
<div id="content">
<div class="container">
@Display(Model.Content)
</div>
</div>
}
@if (Model.BlogZone != null)
{
<div id="content">blog zone
<div class="container">
<div class="row-fluid">
<h2 class="title-divider"><span>Company <span class="de-em">Blog</span></span> <small>We love to talk!</small></h2>
</div>
<div class="row">
<!--Blog Roll Content-->
<div class="span9 blog-roll blog-list">
@Display(Model.BlogZone)
</div>
</div>
</div>
</div>
}
The "Parts_Blogs_BlogPost_List" part still renders inside of the "Content" zone.
Type in /Blog
instead of Blog
in the placement.info file.
The preceding slash tells Orchard that you mean a global zone (from Layout.cshtml
file), not the local one (each item has it's local Content, Header, Footer, etc. zones as well). There is no such thing as Blog
local zone - that's why you don't see anything.
UPDATE: You need to specify the position as well, ie. /BlogZone:before
or /BlogZone:2
etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With