I’ve taken over the List rendering in Orchard for a specific List so that I could to add a new class to the “ul” tag and two dummy “li” elements to the start and end of the items (needed for proper “visual-effects” the web designer devised). This is the overriden template code:
@using Orchard.DisplayManagement.Shapes;
@{
var list = Model.List;
var items = list.Items;
var count = items.Count;
var listTag = Tag(list, "ul");
listTag.AddCssClass("historia");
var index = 0;
}
@listTag.StartElement
<li></li><li></li>
@foreach (var item in items) {
var itemTag = Tag(item, "li");
if (index == 0) {
itemTag.AddCssClass("first");
}
else if (index == count - 1) {
itemTag.AddCssClass("last");
}
@itemTag.StartElement
@Display(item)
@itemTag.EndElement
++index;
}
<li></li><li></li>
@listTag.EndElement
<div class="scroll">
<hr />
<p>
<input type="button" value="back" />
</p>
<div class="dot"></div>
<div class="dot"></div>
<div class="local"></div>
<div class="dot"></div>
<div class="dot"></div>
<p>
<input type="button" value="next" />
</p>
</div>
@Display(Model.Pager)
Now I’m trying to display the List’s Title and I’ve noticed it simply didn’t get displayed neither with my custom rendering nor with the standard List rendering routines. I’ve tried adding these few options to the layout to now avail:
<h1>@Model.Title</h1>
@Display(Model.Header)
@Display(Model.Title)
@Display(Model.List.Header)
@Display(Model.List.Title)
<h1>@Model.Header.Items[0].Title</h1>
With no success whatsoever! What am I missing? (of course this is a neophyte question 🙂
I can’t believe I forgot to check the Placement.info file! It seems to me that the collective sum of all placement.info files is the holy grail of Orchard theming!
The Orchard.Web\Modules\Orchard.Lists\Placement.info file looks like this:
Notice that the title part is sent into oblivion with the ‘-‘ special placement?
All I had to do was to override it on my theme’s placement info:
I told you this was a noobie question! After all I was able to answer it myself! Sorry to bother the community with this silly question!