Hi!
I'm new to Umbraco and are looking for advice.
I want to know the easiest and best way in Umbraco to show article details on a site with the article name in the URL.
For example: I have a database with a Artists table. I have a page on my site with a list of the artists. When i click on one artist i want to get to "www.x.com/artists/artistname" with artist details.
Umbraco will, by default, look for an item on the content tree that follows the convention:
Content --> Artists ----> Artist 1 ----> Artist 2 ----> Artist 3
And so on. If those items don't actually exist as Umbraco content items, then you'll want to create some standard MVC controllers which fetch data from your database and populate a view - essentially bypassing Umbraco's processing.
You can tell Umbraco not to process certain Url's by using the umbracoReservedPaths setting in your Web.Config:
At the risk of hijacking a thread I have a similar question. Lets say in the above example you'd have Umbraco set up like this:
Content
--> Artists
----> Artist
Where Artist is a page where I'd like to display the content of a table completely unrelated to Umbraco. I could ofcourse use query string variables to differentiate:
/Artists/Artist/?id=1234
But for SEO purposes I'd much rather get a URL like this:
/Artists/Artist/1234/Name-of-the-artist/
But then have Umbraco render the template that is associated with the /Artists/Artist/ url. I suppose URL rewriting could (and probably should) be used here, but
I don't know how I should go about configuring this in Umbraco
Both the name Artists as well as Artist are just Umbraco nodes and can be renamed by the end user at will.
I'm sure one of you is brilliant enough to help me out with a solution to these issues.
When i my add artist to umbracoReservedPaths in web.config and try to open the page i get "HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.". Does anyone know what the problem is?
You're essentially ending up a with a hybrid of an Umbraco site and a regular non-Umbraco MVC site - but as long as you keep your routing, controllers and views organised consistantly, there's nothing wrong with this approach.
Thank you for your help. Unfortunately I'm pretty new to MVC and can't get the routing to work. I have a controller named "ArtistsController", and i want to run the Index method in it with an id; like Artists/Index/3. It would be terrific if you or someone else could show me how I should do the routing, or show me slightly more detailed guide.
Easiest way to get www.x.com/article/name
Hi! I'm new to Umbraco and are looking for advice. I want to know the easiest and best way in Umbraco to show article details on a site with the article name in the URL.
For example: I have a database with a Artists table. I have a page on my site with a list of the artists. When i click on one artist i want to get to "www.x.com/artists/artistname" with artist details.
Any suggestions?
/Utte
Umbraco will, by default, look for an item on the content tree that follows the convention:
And so on. If those items don't actually exist as Umbraco content items, then you'll want to create some standard MVC controllers which fetch data from your database and populate a view - essentially bypassing Umbraco's processing.
You can tell Umbraco not to process certain Url's by using the umbracoReservedPaths setting in your Web.Config:
At this point, you're free to set up your own MVC routes and controllers, just like you would in any other project.
Thank you Chris, I will try it out tomorrow.
At the risk of hijacking a thread I have a similar question. Lets say in the above example you'd have Umbraco set up like this:
Where Artist is a page where I'd like to display the content of a table completely unrelated to Umbraco. I could ofcourse use query string variables to differentiate:
But for SEO purposes I'd much rather get a URL like this:
But then have Umbraco render the template that is associated with the /Artists/Artist/ url. I suppose URL rewriting could (and probably should) be used here, but
I'm sure one of you is brilliant enough to help me out with a solution to these issues.
When i my add artist to umbracoReservedPaths in web.config and try to open the page i get "HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.". Does anyone know what the problem is?
@Utte - you'll need to create a route to your controller, in the usual MVC fashion (see here: http://www.asp.net/mvc/tutorials/older-versions/controllers-and-routing/asp-net-mvc-routing-overview-cs)
You're essentially ending up a with a hybrid of an Umbraco site and a regular non-Umbraco MVC site - but as long as you keep your routing, controllers and views organised consistantly, there's nothing wrong with this approach.
@Robert Mulder
This should be possible with some custom routing, I'll have to have a dig around in some code and post later.
Thanks Chris, I appreciate any help you can provide.
@Chris Perks
Thank you for your help. Unfortunately I'm pretty new to MVC and can't get the routing to work. I have a controller named "ArtistsController", and i want to run the Index method in it with an id; like Artists/Index/3. It would be terrific if you or someone else could show me how I should do the routing, or show me slightly more detailed guide.
is working on a reply...