I have an Umbraco website and I'd like to add a regular MVC page to it. So I've mapped attribute routing, so I can map to my controller actions and it all works fine.
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
RouteTable.Routes.MapMvcAttributeRoutes();
}
Which works fine, only not (obviously) when I want to access the CurrentPage object, since it makes no sense to the regular MVC page.
Only, now I'm stuck. What I'd like to do is the following:
Create a BaseViewModel, with a couple of properties (e.q title, meta tag), which checks if they are available in Umbraco (trough CurrentPage?) or if the CurrentPage is not available takes uses a value which I set in the property:
Combining regular MVC and Umbraco
Hi all,
I have an Umbraco website and I'd like to add a regular MVC page to it. So I've mapped attribute routing, so I can map to my controller actions and it all works fine.
So, what I did was create a simple layout:
Which works fine, only not (obviously) when I want to access the CurrentPage object, since it makes no sense to the regular MVC page.
Only, now I'm stuck. What I'd like to do is the following:
Create a
BaseViewModel
, with a couple of properties (e.q title, meta tag), which checks if they are available in Umbraco (trough CurrentPage?) or if the CurrentPage is not available takes uses a value which I set in the property:For example (what I'd want):
And something like this (makes no sense, since CurrentPage is not a property in
BaseViewModel
, but I don't know how to pass it to it either.Thanks in advance!
is working on a reply...