Standard Values

This is the sixth post as part of Sitecore Template series.

In previous posts, we learned about template fields, different field types and importance of template inheritance, in this post, let’s explore Standard Values.

Standard Values are a way to provide default values to template fields. Once we create a Standard Values for a template, and set the default values for fields, any item which is created from this template gets the default values, later content author can also modify the values, on item level.

Standard Values are also useful to have a complete picture of what are all the fields a template has, including the inherited fields.

We can also set default presentation details, and insert options on Standard values.

By looking at Standard Values, we can understand what all the fields a template contains, including the inherited fields.

Let’s take the example of three templates, which are created based on previous post

template-inheritance

Add Standard Value

Let’s explore how to add a Standard Value to Article Template,

Step 1. Open the Content Editor, navigate to Templates & select the Article Template.

template-standard-values-1

Step 2. Select the Builder Options menu from ribbon, and click on the Standard Values. (To view the Builder Options menu, on template level, we need to select the Builder tab)

template-standard-values-2

Step 3. Now we should be able to see __Standard Values item under the Article template.

template-standard-values-3

Step 4. If we look at newly created __Standard Values template, we can observe that there are Article template fields, as well as the inherited fields from Base Content template.

template-standard-values-4

Adding Default Values:

We can add default value to a field, statically or dynamically (with tokens), for the simplicity now let’s add a static value.

Step 1: Open the Article template Standard Values, and select a today’s date for Date field, and save it.

template-standard-values-5

Step 2: Create a new Article item under Home node.

template-field-default-value

Step 3: In newly created Test Article, we can see the Date field value has today’s date, and all other fields are empty. Observe that there is a Standard Value text just beside the Date field name.

field-item-default-value

Step 4: Let’s change the Date field value. Now observe that Standard Value text is disappeared, that means we have broken the Default value inheritance.

field-item-default-value-change

In next post, let’s explore different template types.

Happy Learning 🙂