Applying a different layout to the Blog. Possible without modules?

Topics: Customizing Orchard, General
Mar 10, 2011 at 9:17 PM

So I have two types of content in the site: a) Static pages and b) a blog.

The Theme we are using is customized and the Layout.cshtml is using only the @Zone(Model.Content) inside a div.

But when it comes to the blog, we need a slightly modified  Layout.cshtml, where we can have a list of posts on the left and the blog catagories and search on the right.

Do I need to create a new theme and if so, how to I tell Orchard to use that theme to everything blog related (posts list, post detail, comments, search results).

Can I use conditionals in the default Layout.cshtml, and if so, where can I find samples of the syntax.


Mar 10, 2011 at 10:02 PM

You could use conditionals but the cleaner approach can be read about here:

But that is only if you need the layout to be really different. Another, much simpler approach is to keep collapsible zones like in the theme machine (those zones only get displayed if there is actual contents in them) and use a different widget layer to manage a different set of widgets on your blog. You'd have no widgets in the default layer, and the widget with categories and search in a separate layer that has a rule like url("~/you-blog-slug*").