ListByArchive

Topics: Writing themes
Developer
Nov 16, 2011 at 12:08 AM

Hey Chaps,

How can I overwrite this view? ListByArchive.cshtml within the blogs module?

Cheers in advance!!
NGM

Nov 16, 2011 at 12:27 AM

It's an MVC view, which is why it's in the BlogPost folder. When overriding such views you need to put them in a folder matching the module name. This is because MVC views are often called things like Index.cshtml so you need a differentiator to avoid conflicts when you're overriding.

So your override path needs to be:  ~/Views/Orchard.Blogs/BlogPost/ListByArchive.cshtml

If that doesn't work try: ~/Views/Blogs/BlogPost/ListByArchive.cshtml

I think the first one is correct, but sometimes the built-in modules drop the "Orchard." bit.

Developer
Nov 17, 2011 at 7:43 PM

Ah perfect!! I had this

~/Views/Orchard.Blogs/Views/BlogPost/ListByArchive.cshtml

But your exmple is the one that works ...

~/Views/Orchard.Blogs/BlogPost/ListByArchive.cshtml

Thanks for the heads up.

NGM