Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Getting a CMSEditableRegion to work inside a custom control View modes: 
User avatar
Member
Member
lancetek - 9/21/2011 7:48:29 AM
   
Getting a CMSEditableRegion to work inside a custom control
How can you get a CMSEditableRegion to work inside a custom control?

I've added the code into the .ascx file to use the CMSEditableRegion:


<cms:CMSEditableRegion ID="CMSEditableRegionHeader" runat="server" CheckPermissions="false" HideOnSubPages="false" Visible="true" RegionTitle="Welcome Title" EnableViewState="false" RegionType="TextArea" DialogWidth="700" DialogHeight="200" />


And the region does show up and works properly in the CMSDesk - you can add content and it saves and persists... but on the website it never shows. Do I have to add something into the codebehind file to populate the content?

Again, it works perfectly in the CMS Desk, it can be edited and saves and displays the content...

Thanks,
Lance

User avatar
Member
Member
kentico_michal - 9/21/2011 8:14:39 AM
   
RE:Getting a CMSEditableRegion to work inside a custom control
Hello,

Well, the cms:CMSEditableRegion is intended for CMS Desk (Edit mode). I would recommend using the cms:CMSHtmlEditor control which can be displayed also on the live site:

<cms:CMSHtmlEditor ID="editor" runat="server" IsLiveSite="true" />

Best regards,
Michal Legen

User avatar
Member
Member
garymich - 7/9/2012 10:00:39 PM
   
RE:Getting a CMSEditableRegion to work inside a custom control
Hi,

I tried this and as soon as I try to view it in preview or live site the content I entered into the control seems to get lost. Also, when on the site the editor's toolbars are visible. Any advice about these 2 issues?

User avatar
Member
Member
kentico_michal - 7/10/2012 7:01:32 AM
   
RE:Getting a CMSEditableRegion to work inside a custom control
Hi,

Did you save the specified value somewhere and load it to the editor when necessary? You can access the value throught the ResolvedValue property.

Best regards,
Michal Legen