Blog Zone Placement
Asked Answered
G

1

6

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.

Gwendagwendolen answered 12/2, 2013 at 5:46 Comment(1)
Maybe Blog is an ambiguous name. Try naming the zone BlogZone and see how that works..Actinouranium
L
2

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.

Liba answered 12/2, 2013 at 13:59 Comment(1)
You forgot to specify the position, ie. /BlogZone:before or /BlogZone:2. Putting a zone name alone is not enough.Liba

© 2022 - 2024 — McMap. All rights reserved.