在 Sitecore 中,当向模板添加字段时,有一个名为“共享”的复选框。它是做什么用的?

发布于 2024-09-26 17:11:20 字数 128 浏览 0 评论 0 原文

这似乎是一个愚蠢的问题,但我在我拥有的 sitecore 文档(在线和离线)中可以找到的最接近的答案是共享字段是“跨语言共享”。我认为这意味着共享字段的内容在 sitecore 中该项目的所有翻译中都是相同的。

这是正确的吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

波浪屿的海角声 2024-10-03 17:11:20

是的,这是正确的 - 项目的不同版本和语言都是相同的。这里引用关于共享 来自 SDN(虽然对于 5.3,但对于 6.x 仍然有效):

设置此复选框后,相关字段对于父项目的所有版本都将具有相同的值。设置共享属性后,对任何语言或项目编号版本中的字段值所做的更改都将反映在所有其他语言和版本中。

我可以预见您的下一个问题:如果同时选中“共享”和“无版本化”,则该字段为“共享”。您可以在此处阅读有关其内部存储方式的更多信息在我的博客上

希望这有帮助。

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.

假装不在乎 2024-10-03 17:11:20

我强烈建议尽可能不要使用共享字段。主要原因之一是它们不受工作流程的约束。换句话说,如果您更改共享字段上的值,即使该项目仍在工作流程中,此更改也将被发布。
如果您需要字段值回退,请在渲染级别处理它。

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.

蓝礼 2024-10-03 17:11:20

通常,您会看到图像字段类型的共享字段。例如,苹果的图片不会被翻译。苹果出现在所有语言版本中是有道理的,因此需要共享此图像字段。在内容编辑器中时,内容作者将看到字段标题旁边的[共享]文本。

请参阅 Yan 的关于使用 Siecore Rocks 的博客,因为这个新工具有助于消除困惑。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文