Access system items
Version:
You can use members of the Sitecore.ItemID class to access system items without hard-coding paths. For example, to access the /Sitecore/Media Library item in the Master database:
You can use members of the Sitecore.ItemID class to access system items without hard-coding paths. For example, to access the /Sitecore/Media Library item in the Master database:
Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master"); Sitecore.Data.Items.Item mediaRoot = master.GetItem(Sitecore.ItemIDs.MediaLibraryRoot);