Items

Everything is an Item

Fields on an Item

Various types of fields on an Item. "Title" is single-line text, "Text" is rich text, and "Banner Image" is an image type.

An "Item" is the core building block of Sitecore entities, including content, layouts, renderings, media, settings - everything is an Item.

Conceptually, an Item is just an object with any number of fields defined on it. These fields have data types, such as string, integer, rich text, etc. Sitecore provides dozens of simple and complex data types.

Items can be simple - perhaps even zero fields - or complex - with dozens of fields divided into multiple sections. Items can even be combined conceptually to form other advanced types. A few examples of what Items can represent:

  • Web page
  • Metadata
  • Color
  • User profile
  • Product information

Identifying Items

In the Sitecore Client and in backend code (C#), Items can be easily referenced by their ID or path:

  • ID - a globally unique identifier (GUID); example: {56fc4aa5-99e2-448f-93df-b52e50b1e732}
  • Path - an absolute reference to an Item's location in the content tree; example: /sitecore/content/sites/home/about

Items in Sitecore

Items have fields that store data, and this data is defined by its data type. Sitecore provides simple types (string, text, number, etc.) and advanced types specific to Sitecore (Rich Text, General Link, Multilist, etc.).

Fields can be grouped into sections, which help provide organization and semantic meaning to related fields.

The Sitecore Client provides an interface for creating fields and building up items:

Fields on an Item

The Item Builder interface.

From left to right, each field has several options:

  • Name - the name of the field; will be displayed (by default) to Content Authors; directly referenced in code, so keep this simple
  • Type - data type of this field
  • Source - a location in the content tree to use as the source of data (read: dropdowns, lists, etc.)
  • Unversioned - determines if this field's data will be shared across all numbers versions
  • Shared - fields marked as 'Shared' will update across all language versions of the Item

Items in Code

Item Class in Code

A sample of Sitecore.Data.Items.Item in the Visual Studio Object Browser.

In code, Items are encapsulated by the Sitecore.Data.Items.Item (Sitecore.Kernel.dll) class of the Sitecore API. This class contains fields and properties for representing Item data from Sitecore.

Numerous supporting classes and methods from the Sitecore API allow developers to easily work with Items, including basic create, read, update, and delete (CRUD) operations.