down vote favorite
I am trying to figure out how to create custom routes in composite C1. I have been searching around for hours and came up with noting. I realise you can use pathinfo to slightly customise the route but this really just doesnt do what I need. I basically want to add a few custom routes to override composite C1 if there are any matches
For example I need to map
www.domain.com/job-detail/Executive_Management/HR_Executive/136307 or www.domain.com/job-detail/Executive_Management/HR_Executive?job=136307
to
www.domain.com/job-seekers/job-search/job-detail?job=136307
Please help. I really like Composite C1 but when it comes to custom routes I find it hard to find any help online.
......
Ok more info
I figured this one out by having a further dig through the code. I noticed I could add custom routes to the App_Code\Composite\AspNet\MvcPlayer\Route.cs class.
I added this line of code to the RegisterRoutes method....
routes.MapRoute("Job-Listing", "job-detail/{category}/{title}/{id}", new { controller = "JobSearchModule", action = "JobDetail" });
I added this directly above the default route which is important
routes.MapRoute("Default","{controller}/{action}/{id}",new { action = "Index", id = "" });
.....
Now the problem is that this only routes to the view. I need this to actually re-direct to the page which contains the view (which is displayed using the mvcplayer function) so that the view which is in-fact a widget contains the master layout.
Thanks
David
I am trying to figure out how to create custom routes in composite C1. I have been searching around for hours and came up with noting. I realise you can use pathinfo to slightly customise the route but this really just doesnt do what I need. I basically want to add a few custom routes to override composite C1 if there are any matches
For example I need to map
www.domain.com/job-detail/Executive_Management/HR_Executive/136307 or www.domain.com/job-detail/Executive_Management/HR_Executive?job=136307
to
www.domain.com/job-seekers/job-search/job-detail?job=136307
Please help. I really like Composite C1 but when it comes to custom routes I find it hard to find any help online.
......
Ok more info
I figured this one out by having a further dig through the code. I noticed I could add custom routes to the App_Code\Composite\AspNet\MvcPlayer\Route.cs class.
I added this line of code to the RegisterRoutes method....
routes.MapRoute("Job-Listing", "job-detail/{category}/{title}/{id}", new { controller = "JobSearchModule", action = "JobDetail" });
I added this directly above the default route which is important
routes.MapRoute("Default","{controller}/{action}/{id}",new { action = "Index", id = "" });
.....
Now the problem is that this only routes to the view. I need this to actually re-direct to the page which contains the view (which is displayed using the mvcplayer function) so that the view which is in-fact a widget contains the master layout.
Thanks
David