ASPX templates
Version 3.x > ASPX templates > Problems with CMSEditableImage & CMSEditableRegion in masterpage View modes: 
User avatar
Member
Member
kbonett@uniteform.com - 7/3/2008 3:16:03 AM
   
Problems with CMSEditableImage & CMSEditableRegion in masterpage
I have 4 editable images & text areas defined in the footer section of a masterpage.

In edit mode for one of the (menu item) pages that uses this masterpage, I select 4 images and add appropriate text.

Only the page I edited above displays the footer images/text.

The images/text are not inherited by any other page that use the same master page.

I did use the InheritContent="true" attribute, but I guess that only works for child pages, not siblings?

Any ideas?


User avatar
Member
Member
kbonett@uniteform.com - 7/7/2008 4:20:00 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
Sorry to chase this, but has anyone got any ideas?

I don't want to have to manually add the same editable images/text on every page that uses the masterpage.

btw, I don't know why my original post has been repeated 3 times on the forum. Pls feel free to delete the copies.

User avatar
Member
Member
wayne_thompson@hotmail.com - 7/7/2008 10:01:24 PM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
It was my understanding that editable regions are not inherited.

Have you Tried to create static HTML. That is how i've done it on most of my pages.


User avatar
Member
Member
kbonett@uniteform.com - 7/8/2008 2:50:30 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
We've made editable regions inheritable on child pages, but this scenario is dealing with siblings.

Static html is not going to work as the client wants to be able to update content in the page footer (defined in the masterpage) - hence why we have used editable regions.

User avatar
Member
Member
kentico_vitaja - 7/8/2008 6:02:50 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
Hi,

I'm sorry but I don't understand your issue. What you are trying to achieve?

Do you want to have 4 editable regions inherited from master page? If yes, then add text/images to master page in "Page" tab. Then will be this content displayed in all pages below master page.

It is not possible to inherit from siblings - only from parents. You may want to use same page template in nodes on same level, though I'm not sure if this solves your issues.

Best regards,
Vita Janecek

User avatar
Member
Member
kbonett@uniteform.com - 7/8/2008 6:22:21 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
Thanks Vita,

Let me try to explain my problem in more detail:

All pages on the site (except homepage) share a single masterpage.

I have defined 8 page templates (and corresponding ASPX files) for the different sections of the site. All these files are in the root directory (i.e. they are siblings).

The masterpage footer contains 4 editable images & text regions, which I want to be inherited on all pages.

If I edit one of the pages via CMSDesk (for example, "News") and select images for the footer and add appropriate text, these updates are not inherited by any of the other pages that share the same masterpage.

Is it possible to achieve this?

Thanks...

User avatar
Member
Member
kentico_vitaja - 7/8/2008 8:17:59 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
Hi,

please try to inspire from code below:

MainContentText2.LoadContent(CMS.PortalEngine.PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, "/", "en-us", null, true, CMS.DataEngine.ConnectionHelper.GetConnection()));

You will need to replace MainContentText2 with real ID of your editable region control.

Best regards,
Vita Janecek

User avatar
Member
Member
kbonett@uniteform.com - 7/8/2008 9:18:31 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
Thanks... but no joy I'm afraid...

I added your code to my masterpage's code-behind file and replaced "MainContentText2" as you suggested. No editable text appeared when viewing the live site.

Also, "null" parameter needed to be replaced by "Nothing".

And your code uses CMS.PortalEngine - my site is an ASPX template site, not a portal one.

Sorry....

User avatar
Member
Member
kentico_vitaja - 7/9/2008 3:23:57 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
Hi,

1) This code is working for me therefore it should be working for you.

2) "null" parameter is correct parameter if you are using C#. If you are using VB you should use "Nothing" instead.

3) Yes, my code is using CMS.PortalEngine namespace and it can be used on ASPX templates.

4) I would like to recommend you to contact us at support@kentico.com if you won't be able to solve this alone.

Best regards,
Vita Janecek

User avatar
Member
Member
kbonett@uniteform.com - 7/9/2008 4:42:11 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
Thanks Vita.

I will email support.

The editable regions/images display on just 1 page, not all the others that share the same masterpage.

User avatar
Member
Member
kbonett@uniteform.com - 7/14/2008 11:07:29 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
In case anyone else has the same problem, here is the fix...

The code below refers to a page whose document alias is defined as "Information" via CMSDesk. This page uses a master page which is shared by other (sibling) pages. "HeadingFooter1" is the ID of an editable region defined within the masterpage.master file. Content is added to the "Information" page via CMSDesk.

This code needs to go in master page code-behind:

Protected Overloads Overrides Sub OnPreRender(ByVal e As EventArgs)

HeadingFooter1.LoadContent(CMS.PortalEngine.PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, "/Information", "en-us", Nothing, True, CMS.DataEngine.ConnectionHelper.GetConnection()))

MyBase.OnPreRender(e)
Me.ltlTags.Text = Me.HeaderTags
End Sub

Sub setChild(ByRef child As CMS.Controls.CMSEditableRegion)
child.Enabled = False
child.InheritContent = True
End Sub

Sub setChildImage(ByRef child As CMS.Controls.CMSEditableImage)
child.Enabled = False
child.InheritContent = True
End Sub


Whatever content was added to "Information" is inherited by all other pages.

This works for editable images too.




User avatar
Member
Member
Mufasa - 7/16/2008 2:53:46 PM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
Not sure if this will help or not, but I had an issue when using Portal style pages, where the header of a web site was an image that changed with each page. But the navigation was below that. So my 'editable' content didn't fit cleanly in a block that PagePlaceHolder would work with.

As a workaround, I just put the EditableImage within the PagePlaceHolder area in my page templates, but used CSS positioning in the template to pull it out and position it back up in the header.

Again, this may not apply in your case, but is an easier solution if you know CSS but not ASP.NET.

User avatar
Member
Member
anil.ksingh10-gmail - 5/10/2011 4:43:30 AM
   
RE:Problems with CMSEditableImage & CMSEditableRegion in masterpage
I have easiest solution for it.

CMSEditableRegion has property "InheritContent", which is false by default. If you make it true than your editableregion's content will be inherited to the content pages.

Example:

<cms:CMSEditableRegion runat="server" ID="MainContentText" RegionTitle="Main text" DialogHeight="150" RegionType="HtmlEditor" InheritContent="true" />

Thanks

Anil