Language fallback – changes to APIs
With the language fallback feature, the following APIs have changed.
The Sitecore.Data.Field class
The Sitecore.Data.Field class
The following properties and methods have been added to the class:
-
GetLabel(bool showFieldSharingLabels)– a refactored method that executes thegetFieldLabelpipeline. -
ContainsFallbackValue– a new property that returns true if the field contains fallback value. -
FallbackValueSource– a new property that returns the string descriptor of the fallback value source. -
GetValue(bool allowStandardValue, bool allowDefaultValue, bool allowFallbackValue)– a new method override with theallowFallbackValueparameter.
The Sitecore.Data.Item class
The Sitecore.Data.Item class
The following properties have been added to the class:
-
OriginalLanguage– a property that returns the original language for the current item. If the item is not a fallback item, it returns theitem.Language. -
IsFallback– a property that returns true if the current item is a fallback item.
The Sitecore.Web.SiteInfo class
The Sitecore.Web.SiteInfo class
The following properties have been added to the class:
-
EnableItemLanguageFallback -
EnableFieldLanguageFallback -
EnforceVersionPresence
The ItemAppearance.IsReadOnly class
The ItemAppearance.IsReadOnly class
The following property is changed:
-
IsReadOnly– a property that returns true if theitem.IsFallback is set totrue.
New classes
New classes
Besides the getItem, getFieldValue, and getFieldLabel pipeline processors, the following classes have been introduced to support the language fallback feature:
-
LanguageFallbackManager -
LanguageFallbackStrategy -
DefaultLanguageFallbackStrategy -
LanguageMapping -
LanguageFallbackFieldValuesProvider -
LanguageFallbackFieldValuesCollection -
LanguageFallbackFieldValuesCache -
LanguageFallbackFieldValue -
EnforceVersionPresenceDisabler -
LanguageFallbackItemSwitcher