7

If I check both shared and unversioned checkboxes in a template, what will happen? I knew difference between shared and unversioned. Want to know final result of checking both field in template.

1

Shared will get priority since it covered all versinos in all languages, rather than only versions of a given language happen by Unversioned

  • then what is the use of checking two check boxes? – Basana patil May 24 '17 at 12:31
  • There is no use of setting both checkboxes. – scFootsteps May 24 '17 at 17:01
13

In reality, you have only 3 options. However the combination of checkboxes gives you 4.

The Answer

A versioned field (default)

This acts like one would expect. The field can have multiple values and multiple versions of a value; for multiple languages.

The Unversioned Field

Essentially this field gets 1 version per language, so the designation "Unversioned" is a little misleading. However there will be only 1 version of the field per language, not multiple versions within a language.

The Shared Field

Only one version of this field exists, across language versions.

This leaves out the last combination:

The Shared Unversioned Field

Now one could argue; that in theory it could make sense to have multiple versions of a shared field, but then have the field value propagate across language versions.

However, on a Data Provider level this just isn't possible. There are also areas of the Sitecore UI that would make this approach unworkable.

To find out why, I refer you to Yan Sklyarenko's post Back to Basics: Versioned, Unversioned and Shared Fields, where he explains that field values in Sitecore is essentially stored in one of 3 different tables:

  • VersionedFields
  • UnversionedFields
  • SharedFields

When selecting field values, Sitecore executes a JOIN statement across these 3. A field value will therefore only be selected from 1 of the above.

This is also reflected in the UI of Sitecore Rocks, where this setting is presented as a Dropdown choice.

enter image description here

Shared is therefore a superset of Unversioned

So to answer your question:

Setting both boxes will make your field be Shared. Unversioned is ignored.

Additional reading:

This last article describes the processes that happen under the hood in Sitecore, when you check and uncheck these boxes. A data migration process essentially takes place, moving field values around between the 3 above mentioned tables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.