Senior Director &National Competency Lead – Sitecore Commerce
Multiple Sites Manager Configure Language Fallback
Language fallback now comes in as a new built in feature in Sitecore 8.1. "In a multilanguage solution, you can use the language fallback functionality to control which items or fields that you want to reuse content from another language, and which items and fields that you want to translate. This article outlines how to enable and set up language fallback for multisite solution using Multiple Sites Manager."
Before moving forward, the prerequisite is to install the Multiple Sites Manager module available in the Sitecore Marketplace at this link.
Once the module is installed, you will see a new folder named Sites under sitecore/System as shown below.
- Right click on Sites and Insert a new Site (sample website), fill in the necessary information required for configuring the website.
- Save your changes.
- Right click on the sample website and insert new site attributes named enableItemLanguageFallback and enableFieldLanguageFallback.
- Set the field Value to be true.
- Save your changes and flush sites.
- Open \Website\App_Config\Include\Sitecore.LanguageFallback.config and set the following attributes to true:
<sites> <site name="shell"> <patch:attribute name="enableItemLanguageFallback">true</patch:attribute> <patch:attribute name="enableFieldLanguageFallback">true</patch:attribute> </site> <site name="website"> <patch:attribute name="enableItemLanguageFallback">true</patch:attribute> <patch:attribute name="enableFieldLanguageFallback">true</patch:attribute> </site> </sites>
- For each of the languages under sitecore/System/Languages, add fallback values for the languages used under sample website. for example: If the site uses en-US and es-US, es-US has a Fallback Language set to en-US.
- Sitecore documentation states that, "To use the language fallback functionality, you enable either item-level or field-level fallback on the relevant sites and on the relevant items, fields, or templates. In addition, on the relevant language definition items you specify the fallback language that determines which language version of an item or field that you want displayed when there is no version available in the current language."
- In this article, we will see how to enable item-level fallback. For this, I have used the out of the box Sample Item template located under /sitecore/templates/Sample
- Switch to the __Standard Values for that template, under Advanced tab, enable "Enable Item Fallback"
- Save your changes
- Let's create an item using this Sample Item template under sitecore/Content
- If you switch to es-US version, you will see that there is a fallback version created based on values entered in en-US
This custom feature has been developed and tested against Sitecore 8.1 Update-3.
As always, please test these changes on your development environment before applying it on Production.
For more details on configuring language fallback, please refer to the Sitecore documentation here.