Mar 19, 2012 at 12:22 PM
Edited Mar 20, 2012 at 1:16 PM
Using Theme machine as example, I want to create slightly different pages based on one Layout.cshtml. For example on the home page width of AsideFirst element is 200 px and for other pages it needs to be 400 px. I have created following layers:
one with rule url("~/") and other with rule not("~/"). Based on layer names I want to include home.css OR content.css on my Layout.cshtml. It's a simplified version of what I want to receive as output.
I find only one solution for this, but it's not used layers in base. For resolving css we may use current path:
Style.Include(Context.Request.AppRelativeCurrentExecutionFilePath == "~/" ? "home.css" : "content.css");
But this solution is not suitable for my needs. I do not want to list all possible paths in Layout.cshtml.
How can I link current layers with my css files?
Maybe I thinking in wrong direction and this scenario could be solve with different approach.