Customize Routes per content type

Topics: Customizing Orchard, General
May 5, 2011 at 2:34 PM

Is there a way to customize the routes used for each content type?

I created a content type called Market. I would like the url for each to be ~/market/friendly-url. Is there a way of doing this? I know when I used Drupal a while back you could configure this. 

I know that if you put it in a list, it will automatically add that to the url, but what if I want the list to be plural (~/markets) and the item urls to be singular (~/market/url)?

May 5, 2011 at 3:14 PM

You'd have to build a custom routing part. There's an example of a custom date routing part on this discussion so you can see how it would be done: http://orchard.codeplex.com/discussions/255829

May 5, 2011 at 4:00 PM

The documentation has an example of building a custom Hello World module and modifying the routing behavior by adding a route.cs file:

http://orchardproject.net/docs/Building-a-hello-world-module.ashx?HL=route