Hi I am new to Umbraco and need help to a simple problem (I guess).
I have created a document type with a corresponing template called "Exhibition". Everything is fine and I can navigate to my newly created subpage /Exhibition. The next think I would like, is to add a an id to the url so I can use AngularJS to grab a specific exhibition from the URL e.g /Exhibition/3.
I keep getting No umbraco document matches the url
Adding document match for /id
Hi I am new to Umbraco and need help to a simple problem (I guess).
I have created a document type with a corresponing template called "Exhibition". Everything is fine and I can navigate to my newly created subpage /Exhibition. The next think I would like, is to add a an id to the url so I can use AngularJS to grab a specific exhibition from the URL e.g /Exhibition/3.
I keep getting No umbraco document matches the url
So how's the correct Umbraco way to set this up?
Best regards!
Hey,
You can add an id to the url by using parameters:
Clicking on the URL will open the page www.localhost.local/exhibition/?id=1
If you want to "beatify" the params you should have a look in setting up IIS as I haven't found a way yet to configure this in the config.
You could also make a subitem under exhibition that is called 1 so you would navigate to exhibition/1
You can create a Url Rewrite in the file /config/UrlRewriting.config or on IIS like Nicola mentioned.
The problem with this solution is that it will break when you change the name of your page, because than the url also changes.
Another solution is to use Route Hijacking. But that only works if you use the MVC view engine.
More about route hijacking and custom routes can be found in the documentation :
http://our.umbraco.org/documentation/Reference/Templating/Mvc/custom-controllers
http://our.umbraco.org/documentation/Reference/Templating/Mvc/custom-routes
Dave
Thanks Dave, I gave up on searching but this gives me a new perspective 😁
is working on a reply...