Page Based Layout - OrchardCMS

I ran into a problem when using Orchard that I am sure there should be a fairly simple fix / solution, but I have not found it yet.

I am trying to set a specific area of ​​content width for my home page (580 pixels) and a larger width for content pages (800 pixels).

Layout.cshtml Snippet:

<div id='content'> @Zone(Model.Content) </div> 

Style:

  #Content { [...] width: 580px; } 

Currently - the content div wraps all my content regardless of the page (either the home page or the content). I am wondering if another div can be used to wrap page-based content, as shown below:

Layout.cshtml Idea:

 @if(Model.Page != "Home") { <div id='fullcontent'> @Zone(Model.Content) </div> } else { <div id='content'> @Zone(Model.Content) </div> } 

I'm not sure if the method suggested above is possible (or I'm not sure how to check the current page), but any other suggestions would be appreciated.

+8
styling layout orchardcms
source share
3 answers

You can use the Designer Tools module (built into all recent versions of Orchard) and enable the URL rotation function. Then you can create the layout-url-homepage.cshtml file for your layout.

+13
source share

You can use the layout selector to assign a custom layout to any content item.

http://gallery.orchardproject.net/List/Modules/Orchard.Module.Orchard.DesignerTools

+2
source share

You can use the Vandelay.Classy module to add your own tags to the page representing your home page, although it adds many fields to the page content editor.

+1
source share

All Articles