This project is read-only.

How to override Layout shape for specific url by Orchard.Templates

Topics: Administration, Core, Customizing Orchard, General, Writing modules, Writing themes
Sep 28, 2014 at 11:53 AM
I have a page with the following url:

I can override the Layout shape for this url by creating "Layout-url-foo.cshtml" in my theme.
But i cannot do this by creating a template with this name: "Layout__url__foo".
Is any way to do this in admin UI without modifying theme files?
Sep 29, 2014 at 11:20 PM
I think this was fixed some time ago, but probably after 1.8.1 was released. Not sure, but you can try it by downloading 1.8.x or 1.x.
Oct 3, 2014 at 10:31 AM
Thank you so much. I tested it on 1.8.1. I will test 1.8.x and 1.x ASAP.
Nov 22, 2014 at 1:49 PM
Edited Nov 22, 2014 at 2:24 PM
@sfmskywalker, I tested last 1.x branch today. There is no way to create template by Orchard.Templates for an alternate shape.
Can you help me please? My design depend on this. How can i do for this problem. I need to create template in Admin UI for a shape and an alternate shape for example Layout__url__homepage.

Also there is another problem. I get the following error when i use some simple code in my template:
Ex. i use @Url.Content() or @Html.Raw() and i get this error:
NullReferenceException thrown from IShapeDisplayEvents by Orchard.Templates.Services.TemplateShapeDisplayEvent
System.NullReferenceException: Object reference not set to an instance of an object.
Nov 24, 2014 at 1:05 PM
Edited Nov 24, 2014 at 1:19 PM
Is there any way to create template for an alternate shape (ex. Layout__url__homepage) by Orchard.Templates?
Also another problem is there is no way to override Layout shape for front-end theme only. By overriding Layout shape it is overridden for Admin theme too.