How to inherit editable region content?

giang le asked on April 23, 2014 22:38

Hi all! I using Master Page concept,Kentico 7.x and i have a editable text webpart in parent page, but child pages don't inherit content that i input to editable region of parent pages. I referred topic "http://devnet.kentico.com/articles/how-to-inherit-editable-region-content-when-using-aspx-templates" but this solution for Kentico 6.x and ASPX templates. What other solution for my problems?

Please help me!

GiangLT3

Recent Answers


Girijesh Kumar answered on April 24, 2014 01:55

Hi giang le,

Open editable text webpart properties and find visibility tab, here a check box for "Hide on subpages:" please make sure this should be unchecked

Image Text

Thanks, Girijesh

0 votesVote for this answer Mark as a Correct answer

giang le answered on April 24, 2014 02:06

Thank you reply! Sorry! I include three CMSEditableRegion in a webpart then i drag this webpart to parent page.The "Hide on subpages:" properties of this webpart is unchecked.

<cms:CMSEditableRegion runat="server"  InheritContent="true" ID="xEditableRegion"                           RegionType="HtmlEditor" RegionTitle="x content text" />
<cms:CMSEditableRegion runat="server"  InheritContent="true" ID="yEditableRegion"                           RegionType="HtmlEditor" RegionTitle="y content text" />
<cms:CMSEditableRegion runat="server"  InheritContent="true" ID="zEditableRegion"                           RegionType="HtmlEditor" RegionTitle="z content text" />

GiangLT3

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 24, 2014 06:58

In addition to what Girijesh mentioned, you need to set UseParentContent = true. This will use the parents content if no content is filled in otherwise.

0 votesVote for this answer Mark as a Correct answer

giang le answered on April 24, 2014 21:56

Hi Brenden Kehren! I tried add UseParentContent = true to my code but it's not working.

   <cms:CMSEditableRegion runat="server" InheritContent="true" ID="xEditableRegion" 
    UseParentContent = "true" RegionType="HtmlEditor" RegionTitle="x content text" />

Is it added to Kentico 8.x?

Ps: I use Kentico 7.x

Thank!

GIangLT3

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 25, 2014 05:24

Have you tried the steps mentioned in the article in your first post? It should apply for version 7 as well. I would also recommend applying the latest hotfix.

Best regards,
Juraj Ondrus

0 votesVote for this answer Mark as a Correct answer

giang le answered on April 25, 2014 05:55

Thank you for reply Juraj Ondrus! If There isn't any way to fix this problem, i still have to use the steps mentioned in the article in my first post.But a page in my site have two or three parent pages so i have to switch base on page level to get page parent.

PageInfo parentpi = null;
            switch (CMSContext.CurrentPageInfo.NodeLevel)
            {
                case 3: parentpi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, "", CMSContext.CurrentDocumentCulture.CultureCode, "", CurrentDocument.Parent.NodeID, false);
                    break;
                case 4: parentpi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, "", CMSContext.CurrentDocumentCulture.CultureCode, "", CurrentDocument.Parent.Parent.NodeID, false);
                    break;
                case 5: parentpi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, "", CMSContext.CurrentDocumentCulture.CultureCode, "", CurrentDocument.Parent.Parent.Parent.NodeID, false);
                    break;
            }

Do you have any idea for my solution or other solution?

Thank you!

GiangLT3

0 votesVote for this answer Mark as a Correct answer

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