Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Sitecore, when adding a field to a template, there's a checkbox called "shared". What's it for?

This seems like a stupid question, but the closest answer I could find in the sitecore docs I have (online and offline), is that shared fields are "shared across languages". I took that to mean a shared field's content would be the same across all translations of that item in sitecore.

Is that correct?

like image 860
Bob Black Avatar asked Oct 08 '10 19:10

Bob Black


3 Answers

Yes, that's correct - the same across versions and languages of an item. Here the quote about Shared from SDN (though for 5.3, still valid for 6.x):

When this checkbox is set, the Field in question will have the same value for all versions of the parent Item. When the Shared property is set, changes to the Field value in any language or numbered version of the Item will be reflected in all other languages and versions.

And I can foresee your next question: if both Shared and Unversioned are checked, the field is Shared. You can read more about how it is stored internally here on my blog.

Hope this helps.

like image 158
Yan Sklyarenko Avatar answered Oct 29 '22 23:10

Yan Sklyarenko


I would strongly recommend not using shared fields as much as possible. One of the main reasons is that they are not subject to workflow. In other words, if you change a value on a shared field, this change will be published even if the item is still in workflow. If you need field value fallback, handle it on the rendering level.

like image 7
Alex Shyba Avatar answered Oct 29 '22 21:10

Alex Shyba


Often, you'll see shared fields for Image field types. For example, a picture of an apple isn't going to be translated. It makes sense that the apple appears across all language versions, and hence the need to make this image field shared. When in Content Editor, content authors will see the [shared] text next to field title.

Refer to Yan's blog about using Siecore Rocks as this new tool helps clear up the confusion.

like image 1
seth Avatar answered Oct 29 '22 21:10

seth