November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Could it be related to the new "strict language routing" in 7.5?
http://world.episerver.com/Blogs/Johan-Bjornfot/Dates1/2013/12/Routing-changes-in-75/
Try add a {language} segment to your route, as
"{language}/{node}/{action}/{searchTerm}/{page}"
Thanks for the feedback. I've tried
routes.MapContentRoute(
name: "Search",
url: "{language}/{node}/{action}/{searchTerm}/{page}",
defaults: new { controller = "Search", action = "Index", searchTerm = UrlParameter.Optional, page = UrlParameter.Optional }
);
Unfortunately the route doesn't work and the start page is broken again
This might work:
routes.MapEnterpriseRoutes(
name: "Search",
url: "{language}/{node}/{searchTerm}/{page}/{action}",
defaults: new { controller = "Search", action = "Index", searchTerm = UrlParameter.Optional, page = UrlParameter.Optional }
);
Actually it's not the routes that have fixed it. It is the use of
MapEnterpriseRoutes
instead of
MapContentRoute
I think i need to go back and do some reading.
Cheers
It might be that the route starts to from wrong content root. If no content root is specified in MapContentRoute it will start from SiteDefinition.Current.RootPage. In your case you might want to start route from start page. If so you could use the overload to MapContentRoute that takes in a contentRootResolver delegate and pass in
(s) => s.StartPage
as the delegate parameter
Actually this is still broken. It actually hits the home controller as well as the search controller. Having the custom route runs the home controller in addition to the actually requested controller.
Anyone any ideas what might be going on?
Actually it's the favicon causing the problem. See here for solution
http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=80891
Cheers
Has anyone successfully gotten this to work "MapContentRoute
". Johan, i am not sure i understand passing in the (s)=> as a delagte. I am on 7.5 patch 10, or should I say 7.6. If i use mapenterprise route, it works but all my 404 handling disappears and i still hit the start page. even though the page isn't found
I did get this to work. On the other head, is there a way to remove "Index" from the url?
routes.MapContentRoute(
"SearchPage",
"{language}/{node}/{action}/{pageIndex}/{searchTerm}",
new
{
controller = "SearchPage",
action = "paging",
pageIndex = UrlParameter.Optional,
searchTerm = UrlParameter.Optional
}, (s) => s.StartPage);
Hey Joshua, if you still need this, here is how: http://www.mogul.com/en/about-mogul/blog/registering-a-route-with-an-optional-action-segment-in-episerver-75-and-on
BR,
Marija
In 7 I had a custom route implemented as an initialisable module which enabled me to extend the url for pages i.e.
This would load search pages with search term parameters e.g.
en/search/searchAction/mySearchTerm
would be a valid url. After the upgrade to 7.5 this gives 404s. Also the upgrade had a further bug in which the start page also was 404 - e.g. localhost:17000 could no longer be hit (localhost:17000/home was fine). Removing the route fixes the bug
SO ......
My previously working custom route not only no longer works - it actually causes the start page to give 404s.
Anyone any idea of how to fix this??
Many Thanks