Different theme for Login pages.

Topics: Customizing Orchard, Writing themes
Aug 1, 2014 at 7:02 PM
Edited Aug 1, 2014 at 7:02 PM
I apologize if this has been covered before. I've been looking everywhere for resources to accomplish this.

I have a custom theme created that I would like to use specifically for login pages (LogOn, Register, Change Password, etc.). I was able to dynamically switch the theme in code using IThemeSelector in the Orchard.Users module - However, when I do this, every page on the site uses my custom theme instead of the currently applied theme. Here's the code that I dropped in the Orchard.Users module if it helps.
namespace Orchard.Users 
    public class UsersThemeSelector : IThemeSelector 
        public ThemeSelectorResult GetTheme(RequestContext context)
            return new ThemeSelectorResult 
               Priority = 10,
               ThemeName = "CustomTheme.Users" 
My question is: What might be the best way to display a different theme specifically for pages that deal with user registration/login? Should I be applying this theme dynamically for specific URLs instead of the Users module, and how do I accomplish this if I go this route?

Thanks for reading
Aug 1, 2014 at 8:56 PM
Check the current page, you can also check the current route values (controller + action) and then retiurn different values.

The default theme is in the SiteSettings, look at the default IThemeSelector to see how to get it.
Marked as answer by aacdplex on 8/4/2014 at 7:38 AM
Aug 4, 2014 at 2:38 PM
Thanks Sebastien, that seems to be the solution. Got it working now.