Just wondering if anyone might be able to offer some help on what I would imagine is something others have come across.
I have an mvc site structure with a controller that has multiple action methods which have associated views. So for example.
Controller - MyNews (inherits from RenderMvcController) ActionMethod - Index ActionMethod - Create
The Mvc Url should be /MyNews/ and /MyNews/Create as they would be in MVC
Ive created a single document type called MyNews and 2 templates, one for the index page and one for the create however the link to document for the create template is simple /create/ (without the /MyNews/ on the front)
Am I donig something wrong as the way I understand umbraco route hijacking is that if I create a new doc type it will need a new controller which isnt what I want in terms of both the route and working with the controllers.
I guess my question is can I have a single controller with multiple doc types?
Having slept on this im wondering if this is the only way to set up the doc type with multiple tempaltes. It could be an idea to write custom routes so the /MyNews/Create points to the correct controller and action method which would then return the umbraco view.
This doesnt feel like the correct way of doing it though, feels more like a workaround..
Mvc Architecture and umbraco Doc Type
Hey guys,
Just wondering if anyone might be able to offer some help on what I would imagine is something others have come across.
I have an mvc site structure with a controller that has multiple action methods which have associated views. So for example.
Controller - MyNews (inherits from RenderMvcController)
ActionMethod - Index
ActionMethod - Create
The Mvc Url should be /MyNews/ and /MyNews/Create as they would be in MVC
Ive created a single document type called MyNews and 2 templates, one for the index page and one for the create however the link to document for the create template is simple /create/ (without the /MyNews/ on the front)
Am I donig something wrong as the way I understand umbraco route hijacking is that if I create a new doc type it will need a new controller which isnt what I want in terms of both the route and working with the controllers.
I guess my question is can I have a single controller with multiple doc types?
Thanks
Having slept on this im wondering if this is the only way to set up the doc type with multiple tempaltes. It could be an idea to write custom routes so the /MyNews/Create points to the correct controller and action method which would then return the umbraco view.
This doesnt feel like the correct way of doing it though, feels more like a workaround..
Hi Neil, good to see you on our Umbraco :).
What are you actually trying to achieve by doing this? What is the end goal? And i will try and help.
Route hijacking is access a route that is the template/doctype name before the page is rendered :)
Charlie
is working on a reply...