how to apply URL alternates to multiple pages

Topics: Customizing Orchard
Aug 10, 2012 at 8:12 AM

I have 5 pages on my site which need a common layout that is different to the rest of the site. I have just learned about URL alternates and understand that I can create one for each page, but I was wondering if there is a way I can do this for the 5 pages without having to create a separate view file for each one.

The reason I ask is because I think it would be easier to maintain if I want to update the layout at a later date, rather than to make the same update in 5 separate view files.

Is there a way I could do this perhaps? 

Aug 10, 2012 at 5:25 PM

You could keep the 5 alternates, but have them render a partial.  That way you only change the partial when something needs modified.  I'm sure there are other ways, but that's the first thing that comes to mind.

Aug 11, 2012 at 7:10 PM

thanks. that sounds like a good approach

Coordinator
Aug 12, 2012 at 6:55 PM

Another way would be to use this on those five pages: http://gallery.orchardproject.net/List/Modules/Orchard.Module.Downplay.Orchard.LayoutSelector

Aug 17, 2012 at 8:19 AM

Hi Bertrand, I tried LayoutSelector but it doesn't work with the current version of Orchard.

Coordinator
Aug 21, 2012 at 9:07 PM

Contact the author, or fix it.

Developer
Aug 24, 2012 at 11:13 PM
darenkov wrote:

Hi Bertrand, I tried LayoutSelector but it doesn't work with the current version of Orchard.


Perhaps try this fork: http://layoutselector.codeplex.com/SourceControl/network/forks/sfmskywalker/OnestopLayoutSelector