Change the Lists content type to render DL/DT/DD instead of UL/LI

Topics: Customizing Orchard
Jun 23, 2011 at 10:28 PM

I have an accordian jquery plugin and I would like my lists to be rendered as DL/DT/DD tags instead of UL/LI tags to take advantage of the plugin. I have tried using Url Alternates and shape tracing to find where to modify how it is getting rendered but it only seems to be able to modify the code within the LI tags and I need to replace the LI tags. I have reviewed the Orchard.Lists module and can't seem to find the view where the UL/LI tags are getting generated. Any help is appreciated. Thank you.

Coordinator
Jun 23, 2011 at 10:31 PM

This should get you started: http://weblogs.asp.net/bleroy/archive/2011/05/23/orchard-list-customization-first-item-template.aspx

Jun 23, 2011 at 11:07 PM

Thank you,

I read the article. It is very informative. In your article you reference the code that is the default for rendering lists.

"[Shape]
public void List(
    dynamic Display,
    TextWriter Output,"

Which file is it that contains that code?

Coordinator
Jun 23, 2011 at 11:18 PM

CoreShapes.cs

Jun 23, 2011 at 11:35 PM

Thank you, I found it. I didn't download the full source. I am using WebMatrix. I have the full source now and I see it.

Jun 24, 2011 at 12:10 AM

Something interesting I found. The Lists shape for the blog lists uses an Active Template ~/Modules/Orchard.Blogs/Views/Parts.Blogs.BlogPost.List.cshtml but the Active Template for a List is Orchard.Core.Shapes.CoreShapes::List. I have played around a bit and it appears I can override this template by just adding List.cshtml. I will mess with that for a bit and see what I come up with. Thank you for your help.