Topics: Writing themes
Nov 15, 2011 at 11:08 PM

Hey Chaps,

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

Cheers in advance!!

Nov 15, 2011 at 11:27 PM

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.

Nov 17, 2011 at 6:43 PM

Ah perfect!! I had this


But your exmple is the one that works ...


Thanks for the heads up.