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

3

9

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?

Evocative answered 8/10, 2010 at 19:56 Comment(0)
S
17

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.

Suspensive answered 8/10, 2010 at 20:45 Comment(0)
F
7

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.

Fourgon answered 17/10, 2010 at 22:34 Comment(0)
P
1

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.

Pergola answered 11/10, 2010 at 18:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.