Skip to content

benedict-chan/ThemedViewEngines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Themed Razor ViewEngines

Razor ViewEngines with Theme support for new or existing ASP.NET MVC 4 application.

Features

  • When a "theme" is configured, use the views under the corresponding Themes folder
  • If the requested view does not exist, fallback to use the original ASP.NET MVC view route as a default
  • Support Areas (make sure to copy web.config, ViewStart.cshtml)
  • Support Partial Views

Install using nuget

ThemedViewEngines.MVC4

PM> Install-Package ThemedViewEngines.MVC4

What the nuget installed

Once installed, the following is added to your ASP.NET MVC project:

  • ~\App_Start\ThemedViewEnginesBootstrapper.cs
  • A sample theme folder and files ~\Themes\Sample\Views\Shared\_Layout.cshtml
  • An appSettings ThemeName in web.config

Logics to select theme

You can implement your own logics by implementing the interface IThemeSelectorService

    public interface IThemeSelectorService
    {
        string GetThemeName();
        void SetThemeName(string themeName);
    }

CSS, Javascripts

You can solve these by using ASP.NET bundles.

TODO

  • Cache support
  • WebForm ViewEngine

Reference and ideas

A Custom View Engine with Dynamic View Location

About

View Engines with Theme support for new or existing ASP.NET MVC 4 application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors