episerver / Foundation

Foundation offers a starting point that is intuitive, well-structured and modular allowing developers to explore CMS, Commerce, Personalization, Search and Navigation, Data Platform and Experimentation.
https://docs.developers.optimizely.com/digital-experience-platform/docs/optimizely-foundation-demo-sites
Apache License 2.0
132 stars 137 forks source link

Ability to extending routing to include language-market stem #926

Open paulmcgann opened 1 year ago

paulmcgann commented 1 year ago

Hi,

We are working on a poc for adding the market to the url of the foundation site to include the market along with the language segment for example:

https://www.foundtion.com/en-gb/page-one https://www.foundtion.com/en-de/page-one https://www.foundtion.com/en-us/page-one

We have forked the repository and created a sample implementation, the piece we are struggling with is when we use the market switcher in the site this is causing issues, where is is retrieving a 3 letter country code vs a 2 letter country code.

You can see the approach we have taken here: https://github.com/paulmcgann/Foundation/tree/routing

We have added steps to the pipeline and added some initialization you can see this in the following folder: https://github.com/paulmcgann/Foundation/tree/routing/src/Foundation/Infrastructure/Routing

Also we have modified the startup to add the steps into the pipeline here: https://github.com/paulmcgann/Foundation/blob/routing/src/Foundation/Startup.cs#L240-L242

Would someone be able to review and maybe suggest some improvements, as we feel we are not far away from a working solution?