inetmac510
-
8/8/2008 8:55:24 AM
RE:Empty CMSEditableImage
I came up with a way to check this, I added an extension method for the CMSEditableImage class that takes the CurrentPage PageInfo object to check the value of the editable region, don't know if this is the best way or not, but here's the code.
public static bool IsPopulated(this CMSEditableImage editableImage, PageInfo currentPage) { bool isPopulated = false;
string value = currentPage.EditableItems.EditableRegions[editableImage.ID.ToLower()].ToString();
if (!string.IsNullOrEmpty(value)) { value = value.ToUpper(); isPopulated = (value == "<IMAGE><PROPERTY NAME=\"IMAGEPATH\"></PROPERTY></IMAGE>") ? false : true; }
return isPopulated; }
|