Sitecore 5.0 API

ItemRecords.Item Property (DataUri)

Gets the Item with the specified URI.

[Visual Basic]
Overloads Public Default ReadOnly Property Item( _
   ByVal uri As DataUri _
) As Item
[C#]
public Items.Item this[
   Sitecore.Data.DataUri uri
] {get;}

Remarks

An item is a record in a database. Items are the basic building block of a Sitecore site. An item may represent any kind of information, e.g. a piece of content, a media file, a layout etc. Items always have a name and and ID that uniquely identifies the item within the database. Items have a template that defines which fields the item contains. An item represent a single version of piece of content is a single language.

Example

This example gets an item in a database.

public Item GetItem(string databaseName, string id, string language, string version) {
  ID itemID = ID.Parse(id);

  Language itemLanguage = Language.Parse(language);
  
  Sitecore.Data.Version itemVersion = Sitecore.Data.Version.Parse(version);

  Database database = Factory.GetDatabase(databaseName);

  if (database != null) {
    return database.Items[itemID, itemLanguage, itemVersion];
  }

  return null;
}

See Also

ItemRecords Class | Sitecore.Data Namespace | ItemRecords.Item Overload List