Gets the ID of the item.
An ID identifies an object within the system, but not uniquely. The underlying data of an ID is a Guid.
The ID uniquely identifies the item within a database. The item may appear multiple times, but the item is always unique.
Items are usually retrives either by path or by ID. It is much faster to retrieve items by ID than by path. Sitecore defines a number of wellknown IDs for fast retrival.
The following example retrieves the workflow root item, under which workflows are defined.
{{{
public Item GetWorkflowByName(string name) {
Item root = Sitecore.Context.ContentDatabase.Items[ItemIDs.WorkflowRoot];
if (root != null) {
return root.Children[name];
}
return null;
}
}}}
Item Class | Sitecore.Data.Items Namespace