I'm using route hijacking in an Umbraco 7.1.1 project and I have a weird issue.
I have a document type called Textpage and this document type is allowed to have child nodetypes of the same document type, i.e, Textpage. Also, the template of the document type is called Textpage.
In the backoffice I have something like this:
Textpage
Child textpage 1
Child textpage 2
Child textpage 3
My controller is very simple:
public class TextpageController : RenderMvcController
{
private readonly ICommonService commonService;
private readonly ITextpageService textpageService;
public TextpageController(ICommonService commonService,
ITextpageService textpageService)
{
this.commonService = commonService;
this.textpageService = textpageService;
}
public ActionResult Textpage()
{
var model = textpageService.GeTextpage(commonService.PageId);
return View(model);
}
}
This works perfectly for Textpage but it doesn't work at all for any Child textpage and I don't know why, considering that the document type and the template are the same.
I'm not getting any error, in fact the http response is 200 but I see a blank page and my custom controller doesn't execute.
I'd appreciate any ideas you have to solve this issue.
route hijacking and child document type
Hi,
I'm using route hijacking in an Umbraco 7.1.1 project and I have a weird issue. I have a document type called Textpage and this document type is allowed to have child nodetypes of the same document type, i.e, Textpage. Also, the template of the document type is called Textpage.
In the backoffice I have something like this:
My controller is very simple:
As you can see I'm using template routing as described here: http://our.umbraco.org/documentation/Reference/Mvc/custom-controllers#Routingviatemplate
This works perfectly for Textpage but it doesn't work at all for any Child textpage and I don't know why, considering that the document type and the template are the same.
I'm not getting any error, in fact the http response is 200 but I see a blank page and my custom controller doesn't execute.
I'd appreciate any ideas you have to solve this issue.
Thanks. Cristhian.
Solved!!
I had this route:
I changed that for this:
And now everything is working like a charm.
Cheers,
Cristhian.
is working on a reply...