This project is read-only.

Layout Selector

Topics: Administration, Customizing Orchard, Writing modules
Feb 13, 2014 at 1:28 PM
Hello! I have a problem.
There is almost finished website which must be made in orchard "shell." I would like to make it in a way when making content through admin (New Page), after the bottom of the field where you insert the main text would be a choice Layout's. I have tried to do it using Layout Selector module, field for selection Layout appeared but there is only one Layout named "Default". How to make one more Layout and make it visible in selection?
I kindly ask you to help me solve that problem.
Feb 15, 2014 at 8:35 PM
I installed the module and I think I made it work.
It's a little old and lacks documentation. But I think that I understand what the author wanted to do.
What this module allows to do is to change the full layout file that will be used to show your content item.
  1. Install the module.
  2. Edit the file that is inside that module: "Downplay.Orchard.LayoutSelector/Services/DefaultLayoutAlternatesProvider.cs"
  3. Change the line:
yield return "Default";
            return lst.AsEnumerable<string>();
  1. Now go to your views theme folder, maybe it is in "Orchard.Web/Themes/TheThemeMachine/Views". There you will see a file "Layout.cshtml". This is the default layout that Orchard uses.
    Duplicate the "Layout.cshtml" to "Layout-MyCustomLayout.cshtml".
    Add your desired changes to this new file. To see if everything works simply add "<h1>HELLO CUSTOM LAYOUT</h1>" to the header.
  2. Now go to your dashboard:Content Definition and edit the Page Content Item.
    Add a part "Layout Selector". Save Changes to Page Content Item.
  3. Go to your dashboard:Content:Create New Content : New Page.
    In the new page add some dummy content , click "show on a menu" and select "main menu".
    Select Layout:MyCustomLayout.
    Click Publish Now.
  4. Finally go to your frontend and look at your page. If everything was OK you should see in the header the words "HELLO CUSTOM LAYOUT".
  5. Now it comes the hard work, create the new layout by changing the "Layout-MyCustomLayout.cshtml" file.
BUT, To be honest, I think that the kind of thing you are trying to do will be much easier to achieve by using the new module that you can find here: onestop layouts
Feb 19, 2014 at 1:28 PM
You have no idea how seriously you helped me! I express my great gratitude!
Feb 20, 2014 at 9:22 AM
Edited Feb 21, 2014 at 8:56 AM
None of them came up to me.
Feb 21, 2014 at 8:53 PM
I downloaded this file:

Extracted it, and copied to a folder "Onestop.Layouts" inside my "Modules" folder
Then in the dashboard go to modules and enable both modules:
- OneStop Layouts
- OneStop Shape Template Selector

After this you should see two new menus in the dashboard: Layouts and Templates.
You can follow the docs that explain how to use it:

I did not used this module a lot. Only took a look at it. But I heard this will be the way to go in future versions of Orchard. And has been tested in the company "One Stop" for some time.

Best regards,
Matias Molleja

Jul 16, 2014 at 4:42 PM

We are exploring your “onestop layouts” module and it looks promising for use with assisting with the internal layout of the parts of a content type.

We have read and followed all the “onestop layouts” docs at, but we are unable to place a custom content type in a zone and have it show up in all pages or be able to specify specific pages in cases where one only wants the content on selected pages i.e. aboutus and services.

Can anyone offer any insight or “How To” step to do this?

Thanks in advance,