I'm currently trying to use the UmbracoVirtualNodeRouteHandler for mapping custom routes to content nodes.
No I need to create a new route for each content node of a specific type. on startup of the application everything works fine. Routes are getting registered and are usable.
Problem is now that I also want to register the routes when a new content node is created. I implemented the logic for this thanks to code from Articulate package and the custom routes are cleared and registered.
But when I try to open the route in the browser I get a 404 error.
After restarting the website everything is working.
Is it possible at all to register routes while the website is running?
thanks for answering. Will see if I open an issue on the tracker.
How have you handled the issue in the end?
Was thinking about moving to ContentFinder but don't think that you can use RouteHijacking with them to use an additional parameter in the template methods in the controller.
Refresh routes registered when new content is created
Hi all,
I'm currently trying to use the UmbracoVirtualNodeRouteHandler for mapping custom routes to content nodes.
No I need to create a new route for each content node of a specific type. on startup of the application everything works fine. Routes are getting registered and are usable.
Problem is now that I also want to register the routes when a new content node is created. I implemented the logic for this thanks to code from Articulate package and the custom routes are cleared and registered.
But when I try to open the route in the browser I get a 404 error. After restarting the website everything is working.
Is it possible at all to register routes while the website is running?
Regards David
Hi David,
I notice this as well from time to time. I'm using the code from Articulate as well.
Sometimes after another publish (does not have to be the same item) it starts working. Seems to me routes are cached some way.
Maybe worth creating a issue on the tracker. I never got arround to doing that.
Dave
Hi David,
Here is another thread about this : https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/72025-new-virtual-route-shows-404-after-creation
Dae
Hi Dave,
thanks for answering. Will see if I open an issue on the tracker. How have you handled the issue in the end?
Was thinking about moving to ContentFinder but don't think that you can use RouteHijacking with them to use an additional parameter in the template methods in the controller.
Regard David
In the end we moved to contentfinders. That does the job for us as well.
Dave
is working on a reply...