Understanding Standard Values in Sitecore XM Cloud Data Templates
In Sitecore XM Cloud, data templates play a crucial role in defining the structure and content of items within the content management system. One powerful feature that enhances the efficiency of managing data templates is the concept of "Standard Values." In this blog post, we'll delve into the significance of standard values, their storage, and how they provide default values for fields within data templates.
What are Standard Values?
Definition: Standard values serve as default values for fields within data templates. When the value of a particular field is NULL for an item, the system automatically uses the standard value specified in the data template for that specific field.
Storage of Standard Values
Sitecore stores standard values for each data template as a child item of the data template definition item, aptly named "Standard Values." This organizational structure ensures that standard values are closely tied to their respective data templates. Each Standard Values item is essentially a mirror of the data template it belongs to, inheriting its definition from the parent data template definition item.
Hierarchy of the Sample item data template showing the standard values item.
In the above image, you can see the hierarchical representation of the Sample Item data template, which includes the Data Template section definition item and the associated Standard Values item for the Sample Item data template.
Content of Standard Values Item
The standard values item, much like any other item based on a data template, encompasses all the fields defined in the data template itself. Additionally, it includes any fields inherited from base templates. This makes the standard values item a comprehensive set of default field values for items that are based on the associated data template. These default values come into play when a field value for an item is set to NULL.
Identifying Standard Values in the Content Editor
When working within the Content Editor, it's crucial to be able to identify fields that are utilizing standard values. Sitecore provides a clear indication by displaying the token "[standard value]" immediately next to the field title. This visual cue informs content editors that the displayed value is inherited from the standard values defined in the data template.
An indicator in the user interface shows that there is a standard value used.
Inheritance of Standard Values
An interesting facet of standard values is that they can be inherited from any base template, not restricted to the direct parent template of an item. This flexibility allows for a more dynamic and modular approach to template design, enabling the reuse of standard values across multiple templates in a coherent manner.
Understanding standard values in Sitecore XM Cloud is pivotal for efficiently managing and maintaining data templates. By leveraging default values stored in standard values items, content editors can streamline the content creation process while ensuring consistency and adherence to predefined structures.
Next, check out the tokens that can be used in standard values!