How would skins in MVC? where the client (user) could choose the skin (would change CSS, html, images, etc)?
OBS¹: Skin would be for all pages and each client can only have 1 single skin. But I would have about 10 different skins. These skins can be just a% of% different or a whole different site.
NOTE: If only the Controller can be the same for different skins, Ex: css
will always return the same thing, only the view or _Layout may be different.
I imagine it in 3 ways, however as I do not have great experience in MVC I need FACTS on the advantages and disadvantages of each one, of course it may be that none of the 3 ways I imagine is the best
1 - Filters in the controller:
[VerificarSkin]
public ActionResult MostrarProduto()
{
2 - Changing the layout file by Controller or View
@{Layout = ViewBag.SkinAtual;}
3- Changing the View Folder [ Video explaining this solution a>]
public ActionResult MostrarProduto()
{
var skinAtual = "skin12";
return View("../Views/" + skinAtual + "/Home/index.cshtml");
Solutions:
1 - Advantages: Code Cleanup,
2 - Advantages: I take advantage of the same view for all the skins only mute the layout, however it can also be a disadvantage can not customize the view?
3 - Advantage: Can I change everything, view and layout, but would it give more work?
Scenario: Today I have 300 clients (users) where each one owns its website, these sites are shared from my tool, where it can choose the skins (which are from totally different color changes to layout)