Routing and localisation problem

Member since: 2007

Hi!

Upgrade from Commerce 5.2 to 8.15

I found out that sometime our entry routing is not working when changing language.

We only have entries in English, but the site is in several languages, when changing language, sometimes the entry routing is not found.

We want it to default route to the english entry.

Sure when i remove the language sql in ecf_CatalogEntry_UriLanguage it works, but thats not the right way.

We do have strictLanguageRouting=false

Are we alway suppose to always call /en/myprod.aspx (seems to work) instead of /myprod.aspx?

Is it possible to configure?

#132603 Aug 13, 2015 15:53
  • Member since: 2007

    http://world.episerver.com/blogs/Johan-Bjornfot/Dates1/2013/12/Routing-changes-in-75/

    http://world.episerver.com/blogs/Johan-Bjornfot/Dates1/2012/11/Partial-Routing/

    (if this answers)

    Regards
    /K

    #132615 Aug 13, 2015 18:37
  • Member since: 2011

    Hi,

    You might need to create your own implementation of HierarchicalCatalogPartialRouter, and overwrite this method

     public virtual PartialRouteData GetPartialVirtualPath(CatalogContentBase content, string language, RouteValueDictionary routeValues, RequestContext requestContext)

    For the case EnableOutgoingSeoUri, you can remove the language from the routeValues.

    if (EnableOutgoingSeoUri && requestContext.GetContextMode() == ContextMode.Default)
    {
    // Getting SEO data inside this if because there is a performance cost involved with
    // executing the property getter of the content proxy.
    string seoUri = null;
    var searchEngineInfo = content as ISearchEngineInformation;
    
    if (searchEngineInfo != null)
    {
    seoUri = searchEngineInfo.SeoUri;
    }
    
    if (!String.IsNullOrEmpty(seoUri))
    {
    // For SEO Uri the node and language segments are excluded, remove them
    routeValues.Remove(RoutingConstants.NodeKey);
    
    routeValues.Remove(RoutingConstants.LanguageKey);
    return new PartialRouteData { BasePathRoot = ContentReference.StartPage, PartialVirtualPath = seoUri };
    }
    }

    And then register your class instead of using CatalogRouteHelper

    BTW, I'm happy to see one (more) customer has gone all the way to upgrade to latest version, which I can never recommend enough. Well done!

    Regards,

    /Q

    #132617 Edited, Aug 13, 2015 20:44
This topic is locked because the last reply was posted more than 6 months ago. Please contact epw@episerver.com to unlock it.