Well Known IDs

Well Known IDs

Controls featured in this example:

  • Sitecore Web Control

Classes featured in this example:

  • Sitecore.Data.Items.Item
  • Sitecore.ItemIDs

Well Known IDs C# Web Control Code

Sitecore.Data.Items.Item item = this.GetItem();
if (item == null) return;

string anonUser = Sitecore.ItemIDs.AnonymousUser.ToString();
string branchesRoot = Sitecore.ItemIDs.BranchesRoot.ToString();
string condRendGlobalRules = Sitecore.ItemIDs.ConditionalRenderingsGlobalRules.ToString();
string contentRoot = Sitecore.ItemIDs.ContentRoot.ToString();
string defaultRibbon = Sitecore.ItemIDs.DefaultRibbon.ToString();
string devicesRoot = Sitecore.ItemIDs.DevicesRoot.ToString();
string everyoneRoleID = Sitecore.ItemIDs.EveryoneRoleID.ToString();
string langRoot = Sitecore.ItemIDs.LanguageRoot.ToString();
string layoutRoot = Sitecore.ItemIDs.LayoutRoot.ToString();
string layouts = Sitecore.ItemIDs.Layouts.ToString();
string mediaLibRoot = Sitecore.ItemIDs.MediaLibraryRoot.ToString();
string nullItemID = Sitecore.ItemIDs.Null.ToString();
string placeholdersRoot = Sitecore.ItemIDs.PlaceholderSettingsRoot.ToString();
string policies = Sitecore.ItemIDs.Policies.ToString();
string rootID = Sitecore.ItemIDs.RootID.ToString();
string shell = Sitecore.ItemIDs.Shell.ToString();
string shellAll = Sitecore.ItemIDs.ShellAll.ToString();
string shellDefault = Sitecore.ItemIDs.ShellDefault.ToString();
string sysRoot = Sitecore.ItemIDs.SystemRoot.ToString();
string templateRoot = Sitecore.ItemIDs.TemplateRoot.ToString();
string undefined = Sitecore.ItemIDs.Undefined.ToString();
string workflowRoot = Sitecore.ItemIDs.WorkflowRoot.ToString();

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.Write("C# Web Control Real-time Output");
output.RenderEndTag();

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-size:x-small; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.P);
string displayName = Sitecore.StringUtil.GetString(item.DisplayName, item.Name);
//using : for colon and   for space
output.Write("{0}: {1}", "Item", displayName);
output.RenderEndTag(); //P

output.Write("{0}&#58;&#160;{1}", "Anonymous User", "<b>" + anonUser + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Branches Root", "<b>" + branchesRoot + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Conditional Rendering Global Rules", "<b>" + condRendGlobalRules + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Content Root", "<b>" + contentRoot + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Default Ribbon", "<b>" + defaultRibbon + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Devices Root", "<b>" + devicesRoot + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Everyone Role ID", "<b>" + everyoneRoleID + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Language Root", "<b>" + langRoot + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Layout Root", "<b>" + layoutRoot + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Layouts", "<b>" + layouts + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Media Library Root", "<b>" + mediaLibRoot + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Null Item ID", "<b>" + nullItemID + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Placeholders Root", "<b>" + placeholdersRoot + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Policies", "<b>" + policies + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Root ID", "<b>" + rootID + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Shell", "<b>" + shell + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Shell All", "<b>" + shellAll + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Shell Default", "<b>" + shellDefault + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "System Root", "<b>" + sysRoot + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Template Root", "<b>" + templateRoot + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Undefined", "<b>" + undefined + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Workflow Root", "<b>" + workflowRoot + "</b>");
 
output.RenderEndTag(); //Div


Well Known IDs C# Web Control Output

Anonymous User: {4AF789F7-750F-45C1-B4F0-669A6348482E}
Branches Root: {BAD98E0E-C1B5-4598-AC13-21B06218B30C}
Conditional Rendering Global Rules: {6892B190-D0C8-4628-A179-24D197AB0C07}
Content Root: {0DE95AE4-41AB-4D01-9EB0-67441B7C2450}
Default Ribbon: {073BBB5D-65B5-485F-A1F8-64E55C84696E}
Devices Root: {E18F4BC6-46A2-4842-898B-B6613733F06F}
Everyone Role ID: {00088163-665D-4F6F-9E63-C0CF1FB4E2FE}
Language Root: {64C4F646-A3FA-4205-B98E-4DE2C609B60F}
Layout Root: {EB2E4FFD-2761-4653-B052-26A64D385227}
Layouts: {75CC5CE4-8979-4008-9D3C-806477D57619}
Media Library Root: {3D6658D8-A0BF-4E75-B3E2-D050FABCF4E1}
Null Item ID: {00000000-0000-0000-0000-000000000000}
Placeholders Root: {1CE3B36C-9B0C-4EB5-A996-BFCB4EAA5287}
Policies: {1E7C8D5A-51CF-42A7-8D58-0752B3E39C8B}
Root ID: {11111111-1111-1111-1111-111111111111}
Shell: {4616E2BE-BF68-4D22-91B3-93301C9F86B7}
Shell All: {DF4F23E3-9BAC-42D6-A249-E50CA7475FFD}
Shell Default: {A8653DDD-862E-418F-A312-BD543157E354}
System Root: {13D6D6C6-C50B-4BBD-B331-2B04F1A58F21}
Template Root: {3C1715FE-6A13-4FCF-845F-DE308BA9741D}
Undefined: {FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}
Workflow Root: {05592656-56D7-4D85-AACF-30919EE494F9}