ASPX templates
Version 6.x > ASPX templates > Inherit content from parent View modes: 
User avatar
Member
Member
ovidiu-e-cubed - 11/22/2011 6:14:55 AM
   
Inherit content from parent
Hi,

I've been reading about the visual inheritance model but I don't think it can help me. Here's what I want.

I have 2 templates and 2 pages for each of them. The first page is the parent (in the tree) for the second page. They both inherit the same master page.

Both of them I have this code:

<asp:Content ID="ContentMediaBox" runat="server" ContentPlaceHolderID="MediaBox">
<cms:CMSPagePlaceholder ID="MediaZones" runat="server">
<LayoutTemplate>
<div class="MediaLeft">
<cms:CMSWebPartZone ID="zoneMediaLeft" runat="server" />
</div>
<div class="MediaCenter">
<cms:CMSWebPartZone ID="zoneMediaCenter" runat="server" />
</div>
<div class="MediaRight">
<cms:CMSWebPartZone ID="zoneMediaRight" runat="server" />
</div>
</LayoutTemplate>
</cms:CMSPagePlaceholder>
</asp:Content>


As you can see, I'm having 3 placeholders where I can add widgets. What I want is simple: I want the child to display IN THAT <asp:Content> region the content from the parent.

We discussed over email and here ( http://devnet.kentico.com/Forums/f57/t24086/Getting-widgets-from-another-page.aspx ) about this but I couldn't do it.

Then I saw the "inherit content" option from the page template options and figured it might be what I need.

In your e-mail you said I should use this:

CMS.PortalControls.CMSPagePlaceholder.LoadContent(PageInfo pageInfo, bool reloadData)


Can you give me some code that does the job? I'm clueless as to what to try next.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 11/30/2011 3:45:51 AM
   
RE:Inherit content from parent
Hi,

here is an example which describes how to inherit the content of editable text image in ASPX templates. I hope it helps you:
http://devnet.kentico.com/Forums.aspx?ForumID=23&Thread=00005155

Best regards,
Ivana Tomanickova