Modify List Item

Topics: Customizing Orchard
Jun 1, 2011 at 7:41 AM

How do you modify a list item during display?  Shape designer doesn't let you create a shape for the list items.  The default uses the code below.  It renders an H1.  I don't want a H1.

 

@{
    IEnumerable<object> items = Model.ContentItems;
    Model.ContentItems.Classes.Add("content-items");
    Model.ContentItems.Classes.Add("list-items");
}
@Display(items)

Jun 1, 2011 at 10:05 AM

Each list item is rendered as a Summary shape. You can override any of the individual parts by targetting this. You can use Shape Tracing to help you work out which parts control what; but the title is rendered by Parts.RoutableTitle.Summary.cshtml, which you can override in your theme.