Created
March 7, 2016 15:26
-
-
Save davidknipe/d42c83cfd9e725501393 to your computer and use it in GitHub Desktop.
Override the login page images in Episerver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[InitializableModule] | |
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))] | |
public class OverrideLoginImages : IInitializableModule | |
{ | |
public void Initialize(InitializationEngine context) | |
{ | |
var host = ServiceLocator.Current.GetInstance<IHostingEnvironment>(); | |
if (host == null) return; | |
var mappedProvider = new VirtualPathMappedProvider("OverrideLoginImages", new NameValueCollection()); | |
mappedProvider.PathMappings.Add("/Util/images/login/Pictures_Page_1-min.jpg", "/PathToImages/AwesomeImage1.jpg"); | |
mappedProvider.PathMappings.Add("/Util/images/login/Pictures_Page_2-min.jpg", "/PathToImages/AwesomeImage2.jpg"); | |
mappedProvider.PathMappings.Add("/Util/images/login/Pictures_Page_3-min.jpg", "/PathToImages/AwesomeImage3.jpg"); | |
host.RegisterVirtualPathProvider(mappedProvider); | |
} | |
public void Uninitialize(InitializationEngine context) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment