How to Manage Default Field Values in Sitecore CMS

January 13, 2015

Blog | Development | How to Manage Default Field Values in Sitecore CMS
How to Manage Default Field Values in Sitecore CMS

This is the sixteenth in a series of posts about learning how to use and develop for Sitecore CMS; it is the follow-up post to “How to Change an Item’s Template in Sitecore CMS”. In this “How to” post I will be covering how to manage default field values in Sitecore CMS.

Customizing default values can be especially helpful to content editors when creating content. By specifying good defaults, newly created items can have data pre-populated so that content editors don’t have to waste time with filling in the same fields over and over.

Setting Up Standard Values

To set default field values for a specific template, first you need to create a “Standard Values” item. The standard values item is an item of the given template type which will be used to hold the default field values.

To create the standard values item for a given template, select the template in the content editor.

Sitecore 8 showing a template selected
Sitecore 8 showing a template selected
Sitecore 6 showing a template selected
Sitecore 6 showing a template selected

Template items have a custom “Builder” tab in the content editor. Selecting the “Builder” tab will show a “Builder” tabgroup in the ribbon as well. Select the “Options” tab in the builder section of the ribbon.

Sitecore 8 showing the builder editor and ribbon tabs
Sitecore 8 showing the builder editor and ribbon tabs
Sitecore 6 showing the builder editor and ribbon tabs
Sitecore 6 showing the builder editor and ribbon tabs

Click on the “Standard Values” button in the “Template” section of the “Options” tab in the ribbon. This button will automatically create a new Standard Values item.

Sitecore 8 showing the newly created standard values item
Sitecore 8 showing the newly created standard values item
Sitecore 6 showing the newly created standard values item
Sitecore 6 showing the newly created standard values item

The item will be named __Standard Values so that it doesn’t conflict with any reasonable section names.

The standard values item will be of the selected template’s type. Any modifications to the template will be seen immediately on the standard values item, just like they would on any other item created from the template.

Assigning Default Values

To assign a default value, set the relevant field and save the changes.

Sitecore 8 showing “Example Field” set to “Lorem ipsum”
Sitecore 8 showing “Example Field” set to “Lorem ipsum”
Sitecore 6 showing “Example Field” set to “Lorem ipsum”
Sitecore 6 showing “Example Field” set to “Lorem ipsum”

Any items created from the template will have field values that match the standard values.

Sitecore 8 showing an item created from the template inheriting the default field value in “Example Field”
Sitecore 8 showing an item created from the template inheriting the default field value in “Example Field”
Sitecore 6 showing an item created from the template inheriting the default field value in “Example Field”
Sitecore 6 showing an item created from the template inheriting the default field value in “Example Field”

Fields that have a default value will show “[standard value]” after their field name.

Modifying the field value will remove the “[standard value]” notice:

Sitecore 8 showing a modified “Example Field”
Sitecore 8 showing a modified “Example Field”
Sitecore 6 showing a modified “Example Field”
Sitecore 6 showing a modified “Example Field”

Up next: “How to Reset Fields to Their Standard Values in Sitecore CMS”

Tim Leverett

Senior Developer
Tags
  • Sitecore
Sitecore Survival Guide Volume 1

If you found this post helpful, there are plenty more where it came from! You'll find the first 10 here.

Download the first 10 posts in our Sitecore how-to series by Developer Tim Leverett!

Recent Work

Check out what else we've been working on