Coveo search box multilingual issue
We have a belgium site with 2 languages: nl-BE and fr-BE
Coveo search box on header is configured with the search results page ( which is a relative path in content tree )
when I am on a /nl-BE/ page and click search button - it redirects to http://root/searchresults which ignores the current language selection. Same thing goes for /fr-BE/ pages.
Is there any way to configure coveo search box "language aware" ?
Could you simply have the search box redirect to a different search page depending on the language? Like /nl-BE/searchresults, etc. ?
Out of the box, the Coveo Search Box component doesn't allow this behavior. You can workaround this by:
Duplicate the Coveo Search Box component and its ascx file.
In your custom ascx file, create a C# method that adds the language to an URL and wrap the
Model.GetSearchPageUrl()call in your method like this:
Coveo.$('#<%= Model.SearchBoxUniqueId %>').coveo('initSearchBox', '<%= AddLanguageToUrl(Model.GetSearchPageUrl()) %>');