Reputation: 739
I have created a custom 404 and a custom error page on my Orchard CMS site as described on David Haydan's Blog
The custom template works fine. However the Error shows up with out any of the normal page layout. or styling
How do I use my default Layout.cshtml to render this content ?
this is also happening when I switch to the Theme Machine, Theme.
Upvotes: 2
Views: 1185
Reputation: 198
Are you using the Rewrite Rules module?
If that is the case, then this issue has already been reported here: http://orchardrewriterules.codeplex.com/workitem/11
It says: "It can be fixed by ThemedAttribute". Which is done by adding the attribute "Themed" in the HomeController of project Contrib.RewriteRules/Controllers/HomeController.cs. It will look like below when you're done:
using Orchard.Themes;
using System.Web.Mvc;
namespace Contrib.RewriteRules.Controllers {
[Themed]
public class HomeController : Controller {
public ActionResult Rewrite(string path) {
return new HttpNotFoundResult();
}
}
}
(Reproducing the error is simple. Start up a completely new Orchard site, and test that a 404 does work with The Theme Machine. Then I install and enable the "Rewrite Rules" module version 1.2.5, and you should be able to see the content of NotFound.cshtml without the layout. Disabling the Rewrite Rules module restores it to normal.)
Upvotes: 2