How to Customize List rendering?

Topics: Customizing Orchard, Troubleshooting, Writing themes
Developer
Mar 27, 2011 at 3:18 PM
Edited Mar 27, 2011 at 3:20 PM

Hi,

I'm trying to figure out how to put the title of a List Content Item in a template of my custom theme.
I'm still very new with Orchard, but it is my understanding that List is a Content Type consisting of a Routable part, which in turn has the Title property.

According to this documentation, I should be able to create a template named Content-List.cshtml and override the list rendering here, presumingly like this:

 

@ {

var routePart = Model.ContentItem.As<RoutePart>();

}
<h1>@routePart.Title</h1>

@Display(Model.ContentItem)

 


But whatever I try, the template doesn't seem to kick in, unless I rename the template to List.cshtml. But that will affect the lists being displayed in the Admin area as well, which of course is not very desirable.

Mar 27, 2011 at 4:45 PM

This is related to a known problem with Containers. You can see some details and a fix here: http://orchard.codeplex.com/discussions/250529

Developer
Mar 27, 2011 at 5:27 PM

Ok thanks! That fix will work just fine for me.