Try our conversational search powered by Generative AI!

Mark Hall
Apr 17, 2020
  8146
(2 votes)

Fallback languages for catalog content

I recently had a partner ask me how they could get catalog content to work with fallback languages.  I figured this would be a tough task as been on the roadmap for awhile but tried to give this a shot.  I went looking into resuing the ContentLanguageSetting used in Cms but quickly found the it relies on content being stored in the content tables in the CMS.  The partner use case only needed to fallback to a neutral version if the country specific locale did not exist.  This alllowed me to tackle using code.  

Here is a gist of the code that was used.

Please note the two Get overloads in FallbackLanguageSettingsHandler as this is waht determines the fallback and replacement languages.  Here you could read from config or elsewhere if you need to have more business rules around which languages to choose.  Also note you need to set the strictLanguageRouting="false" in episerver section.

Hopefully this helps someone else trying to do the same thing.

Apr 17, 2020

Comments

Please login to comment.
Latest blogs
Why C# Developers Should Embrace Node.js

Explore why C# developers should embrace Node.js especially with Optimizely's SaaS CMS on the horizon. Understand the shift towards agile web...

Andy Blyth | May 2, 2024 | Syndicated blog

Is Optimizely CMS PaaS the Preferred Choice?

As always, it depends. With it's comprehensive and proven support for complex business needs across various deployment scenarios, it fits very well...

Andy Blyth | May 2, 2024 | Syndicated blog

Adding market segment for Customized Commerce 14

Since v.14 of commerce, the old solution  for adding market segment to the url is not working anymore due to techinal changes of .NET Core. There i...

Oskar Zetterberg | May 2, 2024

Blazor components in Optimizely CMS admin/edit interface

Lab: Integrating Blazor Components into Various Aspects of Optimizely CMS admin/edit interface

Ove Lartelius | May 2, 2024 | Syndicated blog