Category Archive: Kentico CMS

Subcategories: No categories

Retrieving Editable Regions in Kentico

Problem : Retrieve contents of editable regions in Kentico

Kentico CMS allows you to use a custom control called CMSEditableRegion. There are times when you might need to check the contents of this region and perform some checks to implement business rules.

Solution : Check for the EditableRegion property on the Current document

Each document has a property called EditableRegions which is basically a key value pair. If an editable region is on the page then the name (in lower case) is stored as a key in Editable Regions.

if (CMSContext.CurrentDocument.DocumentContent.EditableRegions.ContainsKey("uxpagetitle"))
{
         content = CMSContext.CurrentDocument.DocumentContent.EditableRegions["uxpagetitle"].ToString();
}