Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blog Zone Placement

Tags:

orchardcms

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.

like image 233
Darthg8r Avatar asked Feb 12 '13 05:02

Darthg8r


1 Answers

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.

like image 114
Piotr Szmyd Avatar answered Sep 20 '22 04:09

Piotr Szmyd