Configure standard values
Standard values let you define default field values, default settings, and insert options for a data template. They appear in the content tree as a child item of the data template called __Standard Values.
You can reset a field to its standard value using .NET APIs by using the Sitecore.Data.Fields.Field.Reset()
method. For example, to reset layout details for the context item to its standard value, use the following code:
Sitecore.Data.Items.Item item = Sitecore.Context.Item; Sitecore.Data.Fields.Field field = item.Fields[Sitecore.FieldIDs.LayoutField]; item.Editing.BeginEdit(); field.Reset(); item.Editing.EndEdit();
Configure standard values for fields
To configure standard values for the fields of a data template:
-
In the Template Manager or the Content Editor, select the data template definition item.
-
On the Builder OPTIONS tab, in the Template group, click Standard Values.
Sitecore inserts the standard values item under the data template definition item.
-
With the standard values item selected in the content tree, on the Content tab, enter standard values for each field.
-
On the ribbon, apply standard values for properties stored in the fields of the standard template, such as insert options, layout details, and initial workflow.
Reset a field to its standard value
To reset a field in an item to its standard value:
-
In the Content Editor, select the item.
-
If the field is defined in the standard template, show the standard template fields.
-
On the Versions tab, in the Fields group, click Reset.
-
In the Reset Fields dialog box, select the check boxes for the fields to reset to their standard values, and then click Reset.
-
If the standard template fields are visible, hide the standard template fields.
Reset layout details to standard values
Sitecore provides a shortcut to reset layout details to their standard value. To reset layout details to their standard value:
-
In the Content Editor, select the item.
-
On the Presentation tab, in the Layout group, click Reset, and then acknowledge the prompt. Sitecore resets layout details for the item to those defined in its template’s standard values.
Reset insert options to standard values
Sitecore provides a shortcut to reset insert options to their standard value. To reset inert options to their standard value:
-
In the Content Editor, select the item.
-
On the Configure tab, in the Insert Options group, click Reset, and then acknowledge the prompt. Sitecore resets insert options for the item to those defined in its template’s standard values.