Copied to clipboard

Flag this post as spam?

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


  • Niamh 2 posts 22 karma points
    Feb 01, 2013 @ 12:11
    Niamh
    0

    Master Page issue

    Hi

    I'm new to Umbraco and using Umbraco 6 RC.I have created a master templage with name/alias "ExampleHome" and a child template but when I publish it only display the contents of master page.

    In my sample site I have followed the syntax defined in videos, also installed the package to get idea but it doesn't seem to work. 

    Master template

    ------------------------------------------------------------------

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    <!DOCTYPE HTML>
    <html lang="en">
    <head>
        <title><umbraco:Item field="pageTitle" useIfEmpty="pageName" runat="server"></umbraco:Item></title>   
        <link rel="stylesheet" type="text/css" href="/css/screen.css" media="all" />   
    </head>
       
    <body>
        <div>
            <umbraco:Item field="logo" runat="server" />
        </div>
        <div>

        <asp:ContentPlaceHolder Id="childContent" runat="server">
        </asp:ContentPlaceHolder>
           
        </div>
    </body>
       
    </html>
    </asp:Content>

    ------------------------------------------------------------------

    Child template

    ------------------------------------------------------------------

    <%@ Master Language="C#" MasterPageFile="~/masterpages/ExampleHome.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderId="childContent" runat="server">
        <umbraco:Item field="services" runat="server" />
    </asp:Content>

    ------------------------------------------------------------------

     

    ---------------------------------------------------

    When I publish it should display logo as well as service section contents but it only display logo as shown below.

     

    Am I missing anything ?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 01, 2013 @ 17:50
    Jan Skovgaard
    0

    Hi Niamh and welcome to our :)

    What happens if you enter some hardcoded text in your child template? Does that get displayed?

    /Jan

  • Niamh 2 posts 22 karma points
    Feb 02, 2013 @ 11:35
    Niamh
    0

    Hi Jan,

    Thanks for the response,

    No, it doesn't display the hardcoded text as well.

    But when I add text in master template under content place holder of child template then it display the text (Hello world from Master page!) but doesn't display the child template's text.

     

    Master template

    --------------------------------------

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    <!DOCTYPE HTML>
    <html lang="en">
    <head>
        <title><umbraco:Item field="pageTitle" useIfEmpty="pageName" runat="server"></umbraco:Item></title>  
        <link rel="stylesheet" type="text/css" href="/css/screen.css" media="all" />  
    </head>
      
    <body>
        <div>
            <umbraco:Item field="logo" runat="server" />
        </div>
        <div>

        <asp:ContentPlaceHolder Id="childContent" runat="server">
        </asp:ContentPlaceHolder>
          
            <p>Hello world from Master template!</p>
           
        </div>
    </body>
      
    </html>
    </asp:Content>

    -----------------------------------------------

    Child template

    ---------------------------------------------

    <%@ Master Language="C#" MasterPageFile="~/masterpages/ExampleHome.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderId="childContent" runat="server">
        <p>Hello world from child template!</p>
    </asp:Content>

    ------------------------------------------

     

  • Charles Afford 1163 posts 1709 karma points
    Feb 10, 2013 @ 12:21
    Charles Afford
    0

    Niamh, are you still having problems with this?  Does not look like anything is wrong with the ASP markup.  I would suggest putting sometext in the child templates under:

    <asp:Content ContentPlaceHolderId="childContent"...>

    </asp:Content>

    Otherwise you wont see anything.  Charlie :). 

    I think the problem was that you had no information with in the   <umbraco:Item field="services" runat="server" /> for whatever reason.

Please Sign in or register to post replies

Write your reply to:

Draft