10.5
  1. Access items related to another item

Access the parent of an item

You can use the Sitecore.Data.Items.Item.Parent property to access the parent of an item. For example, to access the parent item (/Sitecore/Content) of the /Sitecore/Content/Home item in the Master database:


Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master");
Sitecore.Data.Items.Item home = master.GetItem("/sitecore/content/home");
Sitecore.Data.Items.Item parent = home.Parent;
If you have suggestions for improving this article, let us know!