Copied to clipboard

Flag this post as spam?

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


  • William Charlton 171 posts 218 karma points
    Feb 23, 2012 @ 13:16
    William Charlton
    0

    Child master pages

    I have what seems to me to be a very simple task to complete and so far I have not managed it.
    I want to have a Master Template with a single ContentPlaceholder.
    I then want to be able to choose one of two (or more when I get it to work) child templates. This is simplicity itself with std .Net master pages.
    So I have:
    Master Template:
    html etc..
     <div class="container_12">
        <asp:ContentPlaceHolder Id="GridLayout" runat="server"/>    
      </div>
    end html etc..

    The two child templates are then:
    Template 1
      <asp:Content ContentPlaceHolderId="GridLayout" runat="server">
        <div class="grid_12">
          <umbraco:Item field="bodyText" useIfEmpty="contents" textIfEmpty="error if no text" runat="server" />
        </div>
      </asp:Content>

    Template 2

     <asp:Content ContentPlaceHolderId="GridLayout" runat="server">
        <div class="grid_6">
            <umbraco:Item field="col1Text" runat="server" />
        </div>
        <div class="grid_6">      
          <umbraco:Item field="col2Text" runat="server" />
        </div>
      </asp:Content>

    Seems pretty straightforward?
    N.B. I've missed out the masterpage directives for brevity.

    When I create a content page and choose Template 2 (which is a child of the MasterTemplate) to enter content, I only see one (rich)text area to add content.

    Can someone explain the explicit steps to achieve this or can it not be done for some reason?

  • William Charlton 171 posts 218 karma points
    Feb 23, 2012 @ 13:42
    William Charlton
    0

    Wierdly I now have been able to do this but don't yet know why previous attempts have failed. The onlydifference this time was that I went for a completly new install and just created the three docTypes and Templates without all the niceties (meta tags, css etc..).

    Previously I have used existing installations and modified templates to convert from one master to master-child so maybe that is where the problems lie. It may also be to do with renaming templates/docTypes or something. This is another of those cases where now I have done an install from scratch that worked I might not encounter this problem again but it would be useful to know what was causing the problems before.

    Any thoughts?

  • William Charlton 171 posts 218 karma points
    Feb 23, 2012 @ 14:12
    William Charlton
    0

    Ithink I have found the problem. When creating a page I get the option to choose a Template.

    On the clean install the Template structure I have is:

    MyMaster
    -- 12 Columns
    -- 6 and 6 Columns

    When I set up a page as say 12 Columns and save, I cannot then later change to 6 and 6 Columns because I don't get the option in the Template dropdown.

    In the old install I have what LOOKS like the same structure and I can change the Template but it does not change the docType, is that usual or a bug?

    Or maybe I am missing something?

Please Sign in or register to post replies

Write your reply to:

Draft