Managing which zones are rendered on different pages

Topics: Administration, Customizing Orchard, Writing themes
Aug 16, 2012 at 3:19 PM

First of all sorry if I'm asking a basic question or something that is already covered by the documentation, but I was wondering how I could manage the layout of different pages in my site with different zones occupying the same area. I wish to have a homepage where I have a slideshow with three sections of 'about us', 'products' and 'contact us' underneath it (much like the tripelfirst-second-third in the theme machine and the main content above it), and I want to have a different layout on my 'about us' page, basically I don't want to have the 3 zones that I had under my main content on the main page but rather a single zone which will span the width of the page (the width of tripel first+second+third), and a different zone underneath main content on my products page and so forth. I've understood that I can use layers to achieve this, i.e. create a unique layer for each webpage and add the widgets to a particular zone on that layer only, but I'm getting a hunch that this is wrong (creating a separate layer for each page seems to be an overkill). So what would be the best way of doing this? Layers?

 

Also I'm assuming that zones in a theme are fixed and can not be changed, so the only way to achieve these different layout is by providing as many zones as possible in the original theme such that one has tighter control over how much space the section can occupy by either providing content for the zone or leaving it empty. Is this assumption correct

Thanks for any help.

Developer
Aug 25, 2012 at 1:43 AM

The ThemeMachine theme is actually very flexible. If you put a widget in just one of the three triples, it will occupy the full width (if not, you need to tweak some CSS to make it do that). As you'll see in the Layout.cshtml of the theme, zones are only rendered if there's actually content in them.

As for creating a layer per page, that depends on how many pages and thus layers we're talking. If it's just 3 pages, I wouldn't worry about it.