public class FrontPageController : RenderMvcController
{
public override ActionResult Index(ContentModel model)
{
//InitializeBaseModel(model);
//var blogService = new BlogService();
var frontPageModel = new FrontPageModel(model.Content);
frontPageModel.Headline = frontPageModel.Value<string>("headline");
return CurrentTemplate(model);
}
}
The alias for the document type is FrontPage
Model:
public class FrontPageModel : BaseModel
{
public string Headline { get; set; }
public FrontPageModel(IPublishedContent content) : base(content)
{
}
}
Template named FrontPageTemplate starts with the following and has a mastertemplate that does not have any model, but just a @RenderBody:
@inherits UmbracoViewPage
I get this error:
Any help would be very much appreciated as i have been struggling for several long hours without any improvement and google has not been my friend!
Problem with code in Custom controller not beging executed (Route hijacking)
I have a problem where the code in my custom controller does not get executed. I think i have followed the guide correctly found here: https://our.umbraco.com/documentation/reference/routing/custom-controllers But the result does not reflect it as it does not work.
Controller:
The alias for the document type is FrontPage
Model:
Template named FrontPageTemplate starts with the following and has a mastertemplate that does not have any model, but just a @RenderBody:
@inherits UmbracoViewPage
I get this error:
Any help would be very much appreciated as i have been struggling for several long hours without any improvement and google has not been my friend!
Change the line in the Controller
To
Also check you've changed the view template top line something like:
Thank you very much! I had missed the detail with the model :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.