Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
// extend PageType EPiServer.DataAbstraction.PageType _pageType = EPiServer.DataAbstraction.PageType.Load(currentPage.PageTypeID); EPiServer.DataAbstraction.PageDefinition _propDef = new PageDefinition(); _propDef.PageTypeID = currentPage.PageTypeID; _propDef.Name = FOLDER_REF_PROP_NAME + i.ToString(); _propDef.EditCaption = FOLDER_REF_PROP_NAME + i.ToString(); _propDef.HelpText = "some help msg ..."; _propDef.DefaultValueType = EPiServer.DataAbstraction.DefaultValueType.None; _propDef.DefaultValue = ""; _propDef.Type = EPiServer.DataAbstraction.PageDefinitionType.Load(4); // 4 = PageReference _propDef.ID = 0; // 0 to create new _propDef.Searchable = false; _propDef.Tab = EPiServer.DataAbstraction.TabDefinition.Load("my tab caption"); try { _propDef.Save(); _pageType.Definitions.Add(_propDef); _pageType.Save(); EPiServer.DataAbstraction.PageType.ClearCache(); } catch (Exception eExp) { // propably property already exists - OK string message = eExp.Message; } currentPage.Property.Add(FOLDER_REF_PROP_NAME + i.ToString(), new PropertyPageReference(new PageReference(_pageId)));