Search code examples
orchardcmsorchardcms-1.8

How to create Layout Based on Layer in Orchard


I am trying to create a different layout for a sub-section of my website using Orchard.

Let's say I wanted to give www.site.com/Shop a different layout from the rest of the website; how would I go about doing this?

I have tried looking for a way to do this using layers but have got stuck.


Solution

  • There are several ways to achieve different layout, since I don't know your specific needs I'll throw in some extra possible routes

    Use url shape alternate (I guess you need this one)

    You have to enable Url Alternates module and it lets you create shape alternates based on url. For example if your page is www.site.com/shop you can then create view under your theme Layout-url-Shop.cshtml and it will be used instead of default Layout.cshtml on your shop.

    Orchard documentantion: URL and Widget Alternates

    Use 1.x or wait for 1.9

    There you can define dynamically different layout per content item aka page. But I find it good only for content not the base layout which is present in layout.cshtml

    Create minisite

    How to create a minisite inside your Orchard website