Perhaps everyone else and their brother realizes it, but after about 4 hours of searching the web, doing trial and error, I finally figured out how to create different page layouts within Orchard. Pretty sure this only works with version 1.1+.
Anyway, I’m redoing me website and on my home page, I want my big banner, on the rest of the pages, I just want to jump straight into the content. This documentation within orchard pointed me in the right direction.
It’s actually pretty easy, simply use the naming convention
In my cases, I wanted to keep the pages consistent, but I wanted have have my logo and primary image on the home page, and leave it empty on the second page. The solution was to provide an alternate layout for the BannerZone.cshtml file.
BannerZone.cshtml is the default one and will be included on all the pages. The contents of this file is empty so no image will be displayed.
BannerZone-url-homepage.cshtml will only be displayed when the user is on the home page, the content of this files contains an image tag that will render the main image and logo.
This seems like a very powerful technique to create small tweaks on different pages. So far, even though it is a very early release. I’m really encouraged what I’m seeing from this platform. Seems to be very extensible and puts a layer of abstraction for all the blocking-and-tackling stuff you need to build for a custom web site. I’m hopeful that with these modules and building blocks, we can focus more time on implementing the business needs of our site and less on the ho-hum functionality.