Language fallback – changes to APIs

Last updated Monday, May 23, 2016 in Sitecore Experience Platform for Developer

With the language fallback feature, the following APIs have changed.

The Sitecore.Data.Field class

The following properties and methods have been added to the class:

  • GetLabel(bool showFieldSharingLabels)– a refactored method that executes the getFieldLabel pipeline.
  • 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 the allowFallbackValue parameter.

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 the item.Language.
  • IsFallback – a property that returns true if the current item is a fallback item.

The Sitecore.Web.SiteInfo class

The following properties have been added to the class:

  • EnableItemLanguageFallback
  • EnableFieldLanguageFallback
  • EnforceVersionPresence

The ItemAppearance.IsReadOnly class

The following property is changed:

  • IsReadOnly – a property that returns true if the item.IsFallback is set to true.

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
Send feedback about the documentation to docsite@sitecore.net.