LibrarySites.Banner

Fallback Series Post 15: Language Fallback with Sitecore 8.1+

You may be familiar with my earlier posts about using the Partial Language Fallback module with Sitecore a few years ago.  This was a separate module that could be installed into a Sitecore instance and although it allowed content to be reused across languages, because it wasn't core to the platform, there were many workarounds and use cases that needed to be custom built to ensure everything worked as expected.  Much of my blog series was there to help developers learn from my own experiences and prevent them from having to re-invent the wheel with those customizations. 

 

A lot has changed since then and starting with Sitecore 8.1, language fallback is now inbuilt to Sitecore.  Many of those customizations are no longer necessary.  Because it all works quite well, out-of-the-box, Sitecore architects and developers can now focus on the really important aspects of Internationalization, Globalization, Localization and Multilingual strategy, rather than the technical how-to.  In 2016, I spoke at the Sitecore Symposium on this topic.  I wanted to make sure what I went over there was in my blog series, as well as provide a few posts on more of the strategy-side of deciding how to implement a language strategy in your Sitecore application. 

I'll start out first with what is now core, then a quick review of what and how (it is far simpler now), and then in later posts go into the strategic questions to help with important decisions and best practices that we follow at Verndale. 

If you used the Partial Language Fallback module in the past, the core product functions very similarly:

  • Set the Fallback Language for each Language in system/Languages
  • Turn on Fallback and Enforce Version Presence at a site level in a config file
  • Select which templates will Enforce Version Presence
  • Select which fields will be enabled for Fallback

The core product is much better now though because:

  • There is far less that needs to be configured in config files, most of it is done now in Sitecore
    • In fact, there are very little config file settings to worry about now
  • Item level fallback is also possible
  • Chained fallback is better supported
  • The Dictionary supports fallback
  • Index Document Builders (search, etc) support fallback

Important Note: the name of the checkbox field to turn fallback on / off on individual fields is different!

  • The module used this: "Enable Fallback if Configured"
  • The core platform uses this: "Enable Shared Language Fallback" (Enable field level fallback)
    • Or "Enable Language Fallback" (Enable versioned field level fallback)

What does this mean to you?  Upgrading a site that was using the fallback module is going to require extra steps to remove the module and customizations and re-enable all of your template fields to enable field level fallback.

One glaringly missing piece of functionality from the core product are the ribbon buttons that one could click to recursively turn on/off fallback and enforce version presence, and it had been a VERY useful part of the module.  The good news is this can be done quickly still with the use of a powershell script and the Sitecore Powershell Extensions Module. 

Toggle On
get-childitem -recurse `
  | where-object { $_.TemplateName -match "Template field"} | set-itemproperty -Name "enable shared language fallback" -Value "1"
 Toggle Off
get-childitem -recurse `
  | where-object { $_.TemplateName -match "Template field"} | set-itemproperty -Name "enable shared language fallback" -Value "0"

The BETTER news, is we have done this for you! You can install a Sitecore package that my colleague, Steve Striga, has put together that replicates that logic using the ribbon. This is available in the Marketplace now: https://marketplace.sitecore.net/Modules/L/Language_Fallback_Tools.aspx
A click of a button will cascade down through templates, checking (or unchecking) the checkboxes for Item Fallback, Field Fallback and Enforce Version Presence.

In my next post, I will briefly go over what Language Fallback is and how to quickly turn it on.