Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Dynamically generated CMSEditableRegion(s) in Portal Enigine custom webpart View modes: 
User avatar
Member
Member
Killian - 2/1/2012 9:15:38 AM
   
Dynamically generated CMSEditableRegion(s) in Portal Enigine custom webpart
Does anybody know of a way to do the following...?

I have a section in a site I am working on where a list of subpages needs to appear inside the body of the parent page.
This list needs to be auto-generated based on the published subpages of that section but also allow the CMS Editor to add an optional image and description to each list item from within the page view of the parent page.

I have created a cutom webpart which I have put into the template. This webpart uses TreeHelper.SelectNodes() to load the subpages into a DataSet and then uses this DataSet to load a custom control ('ListItem') for each row in the DataSet.

The ListItem custom control has some HTML markup, some custom Properties (Title, Link), a CMSEditableRegion control and a CMSEditableImage control. I set the ID of each of the editable controls to use the title as part of the id eg. editableControl.ID = Title + "IntroText"

The setup works properly to render the list and controls within the cms and I can enter information and save the page. However, the saved information does not get rendered on the live view of the page and when I refresh the page view in the cms the content disappears. (it still exists in CMS.CMSHelper.CMSContext.CurrentPageInfo.EditableRegions when I debug).

Is this even possible?

P.S. I know I could create this list entirely from the content on the subpages themselves by adding additional fields to the form tab but I would like to try and do this without creating a new document type or modifying the Page (Menu Item) doctype.

Thanks.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 2/1/2012 10:05:45 AM
   
RE:Dynamically generated CMSEditableRegion(s) in Portal Enigine custom webpart
I think I understand you correctly.

If it were me, and I didn't want to modify the Page (Menu Item) type, I would use the already existing TeaserImage field and put the PageDescription Document Property in the editing form and use that in a transformation to output them where you want them.

Otherwise you're getting into an extremely complicated scenario for a very simple problem.

If all else fails, add the extra fields.

User avatar
Member
Member
Killian - 2/2/2012 3:07:20 AM
   
RE:Dynamically generated CMSEditableRegion(s) in Portal Enigine custom webpart
Thanks, @Jiveabillion.
That should work fine.
I'm still interested in my original question even just as a proof-of-concept if you have any ideas on that.

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 2/20/2012 8:33:12 AM
   
RE:Dynamically generated CMSEditableRegion(s) in Portal Enigine custom webpart
Hello,

So in summary, you want to merge the editing controls for multiple child nodes into a single parent page / form, right?
Our CMSEditableRegion and CMSEditableImage are currently not capable of editing the content of a specific document from a different document (where the editable region is placed).
You would need to use a customized control, where you could programmatically ensure that the content is saved to (and loaded from) an appropriate document DocumentContent XML data, into correct part corresponding with the content of the actual editable region on that specific subpage document.

There are some features planned for the next version that could allow your aim more easily, but it's too early to provide any details now, please try contacting us later if you're still interested in any new options.

Regards,
Zdenek