Field Fallback

  0 rating
11/8/2013 12:19:53 AM
11/8/2013 12:19:53 AM
Source: GitHub

About

Field Fallback is the ability for a field's value to come from somewhere other than the field itself, a clones source, or its standard values. Various fallback scenarios have been provided in this solution with the ability to customize it as needed. The supplied scenarios are: 


    * Ancestor Fallback - A field falls back to the value of its nearest set ancestor
    * Lateral Fallback - A field falls back to the value of another field, or chain of fields
    * Default Fallback - A field falls back to a text value or a token that is transformed at render time (not item creation time!)
    * Language fallback - This is based on Alex Shyba's Language Fallback module ​

The concept for this module came about when Alex Shyba released his Language Fallback module. While the initial prototype, written by ​Elena Zlateva, was heavily based on Alex' work there isn't too much remaining in the FieldFallback.Kernel project. However, to support language fallback while using the Field Fallback module we have provided Partial Language Fallback in the Processors.Globalization project. This code is still very much original to Alex. ​Charles Turano also provided some much appreciated help around performance tuning and getting this to be as fast as possible. 

Download packages

 In the download section


http://twitter.com/ezlateva
http://sdn.sitecore.net/MVP/MVPs/Charles%20Turano.aspx

Sean Kearney

Documentation

Documentation
  • Documentation > Getting Started with the Field Fallback
    Getting Started with the Field Fallback

    Why would I want to use it?

        1. Minimize content redundancy
        2. Reduce editorial effort
        3. Remove Business or UI code to handle fallback logic

    How does it work?

    This module replaces the out-of-the-box StandardValuesProvider with the FallbackValuesProvider. When Sitecore attempts to check for a standard value the FallbackValuesProvider kicks in. There are various tests to see if fallback is supported and if it is the field is placed into a new "fieldFallback" pipeline. The addition of this pipeline allows for a completely customizable way to handle the fallback of a field's value.

    Download and Installation

    The module is supplied at three separate Update Packages that are located at GitHub .

    These update packages contain the files and items that are required.

        * Required: Install the Kernel.Sitecore.Master.update package
        * For general field fallback, install the Processors.Sitecore.Master.update package.
        * For language fallback install the Processors.Globalization.Sitecore.Master.update package

    For more information on how to use Sitecore Update Packages please see: ​http://sdn.sitecore.net/upload/sdn5/resources%20misc/tools/update%20installation%20wizard/update_installation_wizard_guide-a4.pdf

    System Configuration

    The module must be configured via configuration files that are installed to /App_Config/Include/FieldFallback_*.config. By default, Field Fallback is supported on the master and web databases for the shell and website sites. You must modify the Kernel Configuration file to modify this.

    By default no fallback processors are enabled. To enable Ancestor Fallback, Lateral Fallback, or Default Value Fallback modify the general fallback configuration file. To enable language fallback edit the language fallback configuration file.

        * Kernel Configuration - /App_Config/Include/FieldFallback_00.config
        * General fallback configuration - /App_Config/Include/FieldFallback_01.config
        * Language fallback configuration - /App_Config/Include/FieldFallback_02.config

    0
  • Documentation > Ancestor Fallback
    Ancestor Fallback

    This processor allows a field to get a value from its nearest set ancestor.

    Content Item

    Configuration

        1. Make sure that the AncestorFallbackProcessor is enabled in your configuration file.
        2. Each field that requires Ancestor Fallback needs to have the EnableAncestorFallback field checked.

    Settings

    1
  • Documentation > Lateral Fallback
    Lateral Fallback

    A field falls back to the value of another field, or chain of fields

    field value

    Configuration

        1. If a template has a field that requires lateral fallback then that template must be based on the /sitecore/templates/System/Templates/Fallback template template not /sitecore/templates/System/Templates/Standard template
        2. Go to the __standard values of the template or the item itself and make sure View -> Standard Fields is checked.
        3. You should see a "Fallback" section that has a Name Value List field type.
        4. The Key is the field that gets a fallback value. The Value is a '|' separated list of fields to inspect for a value.

    field settings

     

    2
  • Documentation > Default Fallback
    Default Fallback

     A field falls back to a text value or a token that is transformed at render time (not item creation time). This module appears to be similar to out-of-the-box (OOTB) functionality, but is significantly different with regards to 'tokens'!

    OOTB a field can be configured with a 'default' value. This default value isn't stored on the item itself so long as the Default value doesn't have a token in it. If there is a token in the Default value field of a field then when the item is created there will be a value for that field. Using default fallback a 'default value' will never be stored on the item itself even if there is a token in the default value.

    Furthermore, if a __standard value has a token in a field then an item, at creation time, will get the value of that stored on the item itself. Therefore, if you rename an item the field will show the name the item was created with. However, with field fallback, if you rename the item the field value will reflect the new name!

    field settings

    Configuration

    The field that is to have a default fallback value should be edited such that there is a value in the DefaultFieldFallback field.

    field settings

    3
Back
Release notes
The module was added 10-07-2012
Read more Back
Code examples

Solution screenshots(0)

Upload

Reviews (0)

Sort by: Date Most votes
  • Profile Avatar
    [fullName]

    Level: 0

    x0 x0 x0

    [date]

    [title]

    [text]

    Was this helpful?

    0

Comments (0)

Sort by: Date  Most votes

Leave a Comment

Comment must be field in
Post comment
loader

Write a review

Title can't be empty
Review can't be empty
Post review

Download

Title Description Download Action

Add File