Asp.Net MVC Themes, how to?

Jhonny D. Cano -Leftware- picture Jhonny D. Cano -Leftware- · Apr 20, 2009 · Viewed 35.2k times · Source

I have a ASP.Net 2.0 site and want to translate it into MVC paradigm (I'm new to this), but starting from Zero.

I have some themes in my old site, but reading here and there, it seems like Themes doesn't fit well into MVC paradigm.

The question is:

What is the best practice in MVC for building a Themed user customizable site? Can you give a little example, if applicable?

Note: I'm aware of this but they don't talk about best practices or how to start with.

Answer

Chris Pietschmann picture Chris Pietschmann · Apr 22, 2009

Here's my code that I've been using for implementing "Themes" in ASP.NET MVC:

ASP.NET MVC: Implement Theme Folders using a Custom ViewEngine

It's nice when you're able to just swap out CSS files to change the theme, but this really isn't very practical in a ton of cases. Especially when each theme needs to have a completely different layout. In which case, you need to change the CSS and HTML that gets rendered, and this is why I wrote the code found at the above link.