We had an issue where we enabled fallback language settings at the item level on a base template so that it would apply to all of our items. It worked for about 90% of our items but not for others even though the sitecore content editor indicated that it was working.
Placing this here for anyone else who has this issue. I didnt find a specific solution for this issue on Google and was lucky enough to figure it out. Hopefully this can help someone else out too.
Our setup is Sitecore 8.1 with Habitat Asp.net MVC
Here are some steps to make language fallback work for all items by applying item level settings to a base template.
Step 1
First step to enable language fall-back is to set up the fall-back tree. We can build a hierarchical structure (or simple linear) for languages to fall back to Example:
In our case we would just do: EN-NZ --> EN
This is done /Sitecore/System/Languages by setting the fall-back language on each of the language nodes:
Step 2
Next we enable the language fall back feature for the site. At the deployed website locate the config file Sitecore.LanguageFallback.config And modify the config so that the following settings apply:
<setting name="LanguageFieldFallback.AllowVaryFallbackSettingsPerLanguage" value="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>
<patch:attribute name="enforceVersionPresence">true</patch:attribute>
</site>
</sites>
Recycle the app pool
Step 3
Now the feature is enabled for the site we must enable the feature at the item level.
We can apply these settings on the Standard Template and the setting will apply to all Items that inherit it
This will get 90% of our items and fields working, however there is a caveat; this only works for fields that do not inherit their values from Standard Values.
You can easily identify these fields by viewing the Item in the content editor
This is something to do with how the Enable Item Fallback option is also inherited from Standard values of Standard Template and Sitecore won’t apply the setting to the fields that also inherit from standard values.
To handle fields/items in this scenario you do one of two things:
Note: I believe this is a bug because the content editor still displays the fields as inheriting their content from the fall back language when you change language however the content doesn’t render on the website until you do one of the methods mentioned above
Comments