Settings and activity
1 result found
-
8 votes
The following is a solution we are currently reviewing which would resolve a number of these reported feedback requests regarding URL paths. We will continue to review this during future roadmap planning and welcome feedback from interested Customers and/or Partners:
In order to simplify configuration for multilingual sites, we are considering the introduction of a setting to use Home page url segment across whole website so customers won’t need to add language indication to Root Path settings (it would be a new setting to avoid breaking changes)
There would be a new setting 'Use Home Page Url Segment across catalog pages'
- when Enabled - Home page Url Segment will be used across content and catalog pages
- Off by default
- Setting will most likely be Global
- Description - When enabled, Home Page Url Segment will be added to all pages on a website
- Turned ON for new websites, and OFF for…
An error occurred while saving the comment
Polo Jimenez
supported this idea
·
Based on this support ticket: https://support.optimizely.com/hc/en-us/requests/1804446, We’ve identified an issue with multilingual sites where the URLs returned by the api/v2/content/PageByUrl endpoint include an extra /fr/ segment.
Example:
English URL:
/brands/kalas/catalog/wire-and-cable/automotive-wire-and-cable
French URL returned by API:
/fr/brands/kalas/fr/catalog/wire-and-cable/automotive-wire-and-cable
As you can see, the fr segment is duplicated.
Translation Dictionary Configuration:
Catalog_UrlRoot = fr/catalog
Brand_UrlRoot = fr/brands
Observed behavior:
When navigating to a catalog under a brand, the system adds the language segment twice.
Analysis:
We reviewed the source code and found that the issue seems to be in the PathBuilderUtilities.cs class, specifically in the GetCatalogRootPath method:
var languageId = language?.Id ?? SiteContext.Current.LanguageDto?.Id;
This logic always builds the URL with the language prefix from the current SiteContext, which works correctly for standalone catalog pages. However, when the catalog is under a brand, another method has already appended the language segment. As a result, the language prefix (fr) is added again, causing the duplicated segment in the final URL.
Expected behavior:
The method should include a fallback or validation to check whether the language segment is already present in the URL before adding it again. Also, we'd like to customize this piece of code if you don't want to change it. Currently, it is not possible to customize it.
Thanks,
Polo Jiménez