Editable Web Part API Kentico 9

Mark Elliott asked on May 16, 2016 18:11

We are upgrading to v9 and the code upgrade tool flagged this on one of our web parts:

Enumeration CMS.PortalControls.EditablePropertyTypeEnum was removed. FeatureRemoved

We are using this to manipulate the content of the editable text region in the API. Any ideas on what we can use to replace this Feature?

Recent Answers


Trevor Fayas answered on May 16, 2016 19:38

Can you describe what manipulation occurred? What the logic does?

For the value of the Editable Text values, if you can insert instead a custom Macro you often can set the value dynamically through the portal engine, but without knowing more it will be hard to give a proper strategy.

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on May 16, 2016 20:18

Best advice would be to reach out to support@kentico.com to get an alternative for this.

This is removed from kentico 9 so Kentico support might be able to help you out best.

Thanks, Chetan

0 votesVote for this answer Mark as a Correct answer

Mark Elliott answered on May 16, 2016 20:35

Thanks for the response. I created a web part (an accordion control) that I drop editable text parts on each pane of the accordion. I need to be able to manipulate the content of the editable text areas on each of the panes. For example I am calling EditableWebPartProperty.GetHTMLCode

With EditableWebPartProperty being removed I need to find some way to manipulate this.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on May 16, 2016 23:03

Mark, can you give me just the next step. What in the Editable WebPart html are you manipulating, how are you manipulating?

If you put a macro in the Editable Text Content areas, it will give you an area to dynamically add or adjust content.

0 votesVote for this answer Mark as a Correct answer

Mark Elliott answered on May 16, 2016 23:14

I am getting the PaneHeaders property from the Accordion control and looping through setting them into each of the editable text regions:

// Loop through the panes
        for (int i = 1; i <= Panes; i++)
        {
            // Create new pane
            AccordionPane pane = new AccordionPane();
            pane.ID = "pane" + i;

        // Prepare the header
        string header = null;
        if (headers.Length >= i)
        {
            header = ResHelper.LocalizeString(headers[i - 1]);
        }
        if (String.IsNullOrEmpty(header))
        {
            header = "Pane " + i;
        }

        string title = header;

        // check if we are in design view
        if (IsDesign)
        {
            header = EditableWebPartProperty.GetHTMLCode(null, this, "PaneHeaders", i, EditablePropertyTypeEnum.TextBox, header, null, null, null, true);

        }
        else
        {
            header = EditableWebPartProperty.ApplyReplacements(HttpUtility.HtmlEncode(header), false);
        }

        // Set the header of the pane
        pane.Header = new TextTransformationTemplate(header);
        acc.Panes.Add(pane);

        var zone = AddZone(ID + "_" + i, title, pane.ContentContainer);
        zone.Wireframe = true;
    }
0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on May 17, 2016 20:09

Thanks, in this case a macro wouldn't help much since you're trying to use the Widget/webpart's property to fill in the children.

What you'll probably need to do is to manually search the Controls of each Editable Web Part and find the textbox control, then grab it's value.

Stackoverflow has a couple examples of searching a control's children, by type or by ID. I've done similar in the past.

0 votesVote for this answer Mark as a Correct answer

Mark Elliott answered on May 18, 2016 20:29

Trevor, Thanks for your thoughts on this. After some conversations with support it looks like might be able to use the CMSEditableRegion class to manipulate the contents.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.