2
votes

I am very new to Orchard and am still trying to wrap my head around all of the different terminology so anything used out of context here isn't intentional. I am trying to do something similar to what is posted here on SO, but doesn't have an accepted answer.

In a regular site (non-blog), the layout provided by the graphics group for my client has a title section and then two columns below it. So, something like this:

============================================================
|  Page Title                                              |
============================================================
| Left Content                           | Right Content   |
|                                        |                 |
============================================================

The HTML for the title area is:

<div class="page_header">
  <div class="padding">
    <h2 id="page_title">This is the page's title</h2>
  </div>
</div>

Below that block are more divs to split the rest of the page into two columns. The issue I'm having is trying to get the page's title, as entered by the user through Orchard, to show up in the section mentioned above. I tried making it a zone called PageTitle, but the closest I got it to show anything was when I added an empty HTML widget for that placeholder, then did @Model.PageTitle in the tag, i.ie:

<div class="page_header">
  <div class="padding">
    <h2 id="page_title">@Model.PageTitle</h2>
  </div>
</div>

That got the formatting correct, but the title was showing as "ISHAPEPROXYD0FC462A536A4DA88FD49545639B4698" which I'm guessing is some type of default ToString() implementation. If I wrap the @Model.PageTitle in a zone format, i.e. @Zone(Model.PageTitle), nothing shows up again. The other properties I've tried are: @Model.Title and @Model.TitlePart.Title.

I've also tried playing with the placement.info file, but it seems to want content in the PageTitle zone to display anything which doesn't really match what I need. I confirmed this by putting in the following:

<Place Parts_Title="Content:after" />

That line (using before or after) made the title show up, just not in the correct place. When I use what's below, nothing shows up (using before, after, no value, 1, etc.):

<Place Parts_Title="PageTitle:before" />

So, to summarize, how do I get the content's title to show up in that specific area where no other user-initiated content will display?

1

1 Answers

5
votes

I believe what you are looking for is placement of the title into the top level Layout zones. The syntax for this is (assuming you have a PageTitle zone in your layout, but this could be any zone in your layout view). I think this was a feature added in Orchard 1.5:

<Place Parts_Title="/PageTitle:1"/>

Note the forward slash before the zone name. Otherwise the placement default is for the parts to be arranged within local content zones.