Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Jameson 6 posts 26 karma points
    Nov 06, 2010 @ 14:51
    Andrew Jameson
    0

    Child Template not being merge to Master Template

    I'm trying to build my first website using Umbraco and while I think I've got my head around Document Types, Templates and Content and how they link together, I seem to be hitting a brick wall when it comes to merging a template onto my Master Template.

    On my Master Template I have the following markup:

    <div id="left-column">
      <asp:ContentPlaceHolder ID="LeftColumnContent" runat="server" />
    </div>

    I've created another template as a child Template of this Master Template and called it Left Column. On this child template is the following markup:

    <asp:content ContentPlaceHolderId="LeftColumnContent" runat="server">
      Hello world
    </asp:content>

    My problem is that "Hello world" never shows on the page. The <div/> with ID "left-column" is empty.

    I've selected the Master Template from the "Master template" drop-down on the child template, as you can see here: http://screencast.com/t/4uGsSoUVJL

    Does anyone have any idea why this child template is not being merged onto my Master Template?

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Nov 07, 2010 @ 21:12
    Lee Kelleher
    0

    Hi Andrew,

    This might be a red-herring, but have you tried not self-closing the ContentPlaceHolder tag?

    <asp:ContentPlaceHolder ID="LeftColumnContent" runat="server"></asp:ContentPlaceHolder>

    Apart from that, it looks like you've done everything else correctly.  Let us know how you get on.

    Cheers, Lee.

  • Andrew Jameson 6 posts 26 karma points
    Nov 07, 2010 @ 22:36
    Andrew Jameson
    0

    Thanks for the suggestion Lee, but having changed it to this

    <div id="left-column">
    <asp:ContentPlaceHolder ID="LeftColumnContent" runat="server"></asp:ContentPlaceHolder>
    </div>

    The <div/> is still empty.

Please Sign in or register to post replies

Write your reply to:

Draft