Using CurrentPage og Model on a page without a node
Hi,
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.
Using CurrentPage og Model on a page without a node
Hi, 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?
Hi Tom,
You can use UmbracoHelper for getting Home page and use it like model for you view.
Is it make sense for you?
Thanks,
Alex
I tried to make it work with an UmbracoVirtualNodeRouteHandler
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.
is working on a reply...