Search code examples
asp.net-mvc-3dynamic-dataorchardcmsshapes

How to override list shape rendering in module Orchard


I am still new to Orchard.

I have two content type defined as below

public int Create() {
            // Define the tab list type which will
            // contain body details, common, route, menu and be a container
            ContentDefinitionManager.AlterTypeDefinition("TabList",
                cfg => cfg
                    .WithPart("BodyPart")
                    .WithPart("CommonPart")
                    .WithPart("RoutePart")
                    .WithPart("MenuPart")
                    .WithPart("ContainerPart")
                    .Creatable());

            // Define the tab type which will
            // contain body details, common, be containable.
            ContentDefinitionManager.AlterTypeDefinition("Tab",
                cfg => cfg
                    .WithPart("BodyPart")
                    .WithPart("TitlePart")
                    .WithPart("CommonPart")
                    .WithPart("ContainablePart")
                    .Creatable());
            return 1;
        }

I am trying to change the list markup rendering in my module from:

<ul>
<li>...content-item</li>
...
</ul>

to

<ul>
<li>content-item.Title</li>
...
</ul>
<ul>
<li>content-item.Body</li>
...
</ul>

and I only want the list rendering to be changed for this module only.

can someone pointing me a direction please.


Solution

  • Read this: http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx and this: http://weblogs.asp.net/bleroy/archive/2011/05/23/orchard-list-customization-first-item-template.aspx