Sub layouts?

Topics: Administration, General, Writing modules, Writing themes
Mar 20, 2013 at 11:00 PM
Hello there!

I'm fairly new to Orchard and still trying to figure a bunch of stuff out :)
Currently I have made a theme with a layout, that has a header with a menu, a content area and a footer. In the menu I have a few links to home, about, staff and so on.
My question is, how do I have separate layouts/templates on each of these content pages?
I read about a way to have "alternate layouts" but that seems to switch the WHOLE layout for each page (that is, I have to include the header and footer and everything inside each and every page, which I have to create manually and not from the CMS admin page).

I have been reading around and I can't find a definite answer to my question.
Each of the pages should have their own template and set of zones where I can put widgets that I will write later.
Also, is there a way to create these templates, and then make it so that the Administrator of Orchard, can choose what template to use fo each content page that he creates?

PS: In my visual studio project where I'm working with Orchard, I currently have one module that I call "webshop", where most of my pages will be, and then I have the "Theme" project in the same solution file. Should my templates be placed in the views of the theme or in the views of the module? Are there guidelines for this?

I would greatly appreciate if anyone could point me in the right direction, as I'm pretty confused at the moment on what to do :)
Coordinator
Mar 21, 2013 at 12:41 AM
Simplify. What is varying between those pages? Isolate the changes into shapes on which you can create alternates, one by one.
Mar 22, 2013 at 1:29 PM
BertrandLeRoy wrote:
Simplify. What is varying between those pages? Isolate the changes into shapes on which you can create alternates, one by one.
Thanks, I think I figured it out :) (almost)

I now have a template(alternate layout?) called Content-Startpage.cshtml that I use with my Startpage ContentType, which seems to work fine.
But I added a zone simply called "test" to that template, and I can render some shapes there that I added to the ContentType as ContentParts, but when I add a widget to that zone, it refuses to show up.

Does anyone have any idea why?
Coordinator
Mar 23, 2013 at 8:11 AM
Show how you created the zone.
Mar 25, 2013 at 6:14 PM
BertrandLeRoy wrote:
Show how you created the zone.
Solved it! :)

I did it like this at first
@Display(Model.aZone);
And the solution was
@Display(WorkContext.Layout.aZone)
Developer
Mar 25, 2013 at 6:52 PM
Nice. And you could even do it like so:
@Display(Layout.aZone)