best way to create a blank page with a widget

Topics: General, Writing modules, Writing themes
Jul 24, 2013 at 5:13 PM
Edited Jul 24, 2013 at 5:13 PM
Assuming you have a fully themed orchard website with header, footer, styles etc.

How could you create a blank page with a widget, without inheriting the default theme furniture?
Jul 24, 2013 at 5:17 PM
Do you mean you just want the widget, no header or footer etc?
Jul 24, 2013 at 6:45 PM
Edited Jul 24, 2013 at 6:49 PM
yep. i'm thinking partial view or something, but i'm not sure that's the simplest way.

if it was possible to create a layer that didn't inherit the default layer, then that would be one solution.
Jul 24, 2013 at 9:41 PM
If you have the url alternates module switched you can use that, you can create a completely different layout based on the specific url,which would be your page in question.
If you copy the contents your layout file in the theme, or the inherited one, then you can remove the header, footer and anything else, and because its using url alternates it will work seamlessly, powerful stuff but really simple.

I have used this in my most recent project, as I wanted a specific layout for my logon page (no header, footer) so similar to your requirements.
I created a new cshtml file in my views folder called Layout-url-Users.cshtml.
Note the url this is a url alternate.
Then i just striped that down completely.

Hope that makes sense!

Roland
Jul 25, 2013 at 4:37 PM
Edited Jul 26, 2013 at 10:05 AM
Thanks Roland. Just what I was looking for.

(It seems that to get rid of absolutely everything you need to tweak the Document.cshtml stuff too. Though tbh it is an unusual requirement to want to remove everything for a widget, as widgets by their nature should normally belong in pages with other stuff).
Jul 26, 2013 at 9:55 AM
Glad to help.
Clever isn't it, i didn't think of it at first, using alternates for the layout, but when I came across it I thought why didn't I think of that!