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'm not sure I'm able to make this understandable, but here we go!
I have created a custom route to a page called 'course'. The view uses the same layout as the rest of the website, but no matching document/node is created in Umbraco.
So, when I go to http://site.dk/course/index I just want the page to use CurrentPage and Model as if it was on the home node. But I want to show my custom view of course.
Now I'm just getting alot of nullpointers because of the missing CurrentPage and Model.
Any smart way to do this?
You can use UmbracoHelper for getting Home page and use it like model for you view.
Is it make sense for you?
I tried to make it work with an UmbracoVirtualNodeRouteHandler
controller = "Course",
action = "Index",
Id = UrlParameter.Optional
CourseVirtualNodeRouteHandler just returns my homepage node. But I still am missing the RenderModel, Any idea why?
I know this was asked a long long time ago in a galaxy far far away lol but its better late than never to add a fix for future developers.
I have come across the same problem and found that using this command has fixed it.
IPublishedContent CurrentPage = Umbraco.AssignedContentItem;
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted