Mark Hall
Apr 17, 2020
  8218
(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
Creating Custom Feed Options for Optimizely Forms Selection Elements

Optimizely Forms is a versatile tool for building forms used in registrations, job applications, surveys, and much more. These forms can include a...

Nahid | Aug 12, 2024

How to hide Reports from the global menu in Optimizely CMS

Reports section is available by default to all users who are members of the WebEditors group as the authorization policy of that MenuItem is set to...

Bartosz Sekula | Aug 8, 2024 | Syndicated blog

Azure Function App for PDF Creation With Syncfusion .Net PDF Framework

We have a couple of use cases that require internal and external users to print content in PDF format. We've offloaded this functionality from the...

KennyG | Aug 8, 2024

Changes to PictureRenderer.Optimizely

In version 3.2 of PictureRenderer.Optimizely it is possible to add any attribute to the rendered img element. This makes it possible to add e.g....

Erik Henningson | Aug 2, 2024 | Syndicated blog