Hello,
You could use
CMSAbstractWebPart class for setting Content Before and Content after properties for a certain Editable text web part and
CMSContext.CurrentPageInfo.EditableItems["editabletext"] to get the current text content of EditableText web part.
Here is an example of using it in the code:
// Get Editable Text web part
CMSAbstractWebPart EditableTextWebPart = this.PagePlaceholder.FindWebPart("editabletext");
// Check text content of Editable text web part
if (CMSContext.CurrentPageInfo.EditableItems["editabletext"] != "")
{
// Set Content before and Content after properties
EditableTextWebPart.ContentBefore = "<h2>Some content before</h2>";
EditableTextWebPart.ContentAfter = "<h2>Some content after</h2>";
}
else
{
// Set Content before and Content after properties to empty
EditableTextWebPart.ContentBefore = "";
EditableTextWebPart.ContentAfter = "";
}
Best regards,
Filip Ligac