Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to implement a custom route, but getting a "No physical template file was found for template Index" error.
If I remove the custom route, and just load the document it works fine. But as soon as I add in the custom route I get this error.
When I debug at the controller, my model as a templateId and the template file does exist.
RouteConfig:
routes.MapUmbracoRoute( "EventDetails", "programme/event/{id}", new{ controller = "EventDetails",action = "Index"}, new EventDetailsHandler() );
Handler:
public class EventDetailsHandler : UmbracoVirtualNodeRouteHandler { protected override IPublishedContent FindContent(RequestContext requestContext, UmbracoContext umbracoContext) { var helper = new UmbracoHelper(umbracoContext); string alias = typeof(EventDetails).Name; IPublishedContent content = helper.TypedContentAtRoot() .First() .Descendants() .First(d => d.DocumentTypeAlias.InvariantEquals(alias)); return content; } }
Controller (not actually doing anything, tried just not specifing the controller and get the same result):
public override ActionResult Index(RenderModel model) { //Do some stuff here, then return the base method return base.Index(model); }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Custom Route - template file was found Error
I am trying to implement a custom route, but getting a "No physical template file was found for template Index" error.
If I remove the custom route, and just load the document it works fine. But as soon as I add in the custom route I get this error.
When I debug at the controller, my model as a templateId and the template file does exist.
RouteConfig:
Handler:
Controller (not actually doing anything, tried just not specifing the controller and get the same result):
is working on a reply...