Copied to clipboard

Flag this post as spam?

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


  • tesuji 95 posts 139 karma points
    Dec 03, 2010 @ 18:30
    tesuji
    0

    Need something like an #include in my main template

    I have different sections of my website that all share the same basic layout.

    But each section also has one part of the page that will be different, to navigate that section only. It's a sub menu area for that particular section. 

    How can I put that piece in my main template? I'm wanting to use something like an #include for that sub-navigation piece. I will just be a static div.

  • tesuji 95 posts 139 karma points
    Dec 03, 2010 @ 18:34
    tesuji
    0

    PS - I'm hoping to find a simpler solution than a user control. Just including HTML somehow would be ideal.

  • Sean Mooney 131 posts 158 karma points c-trib
    Dec 03, 2010 @ 19:14
    Sean Mooney
    0

    Couldn't you just use nested master templates?

    One master template that has the main structure, with a content place holder where your sub menu will go. Then a template that is a child of the master for each custom section.

  • Sean Mooney 131 posts 158 karma points c-trib
    Dec 03, 2010 @ 19:15
    Sean Mooney
    0

    Or you could create an XLST macro that could read the current section and display the content base on that

  • Tommy Poulsen 514 posts 708 karma points
    Dec 03, 2010 @ 19:17
    Tommy Poulsen
    0

    Hi Tesuji, maybe I'm not understanding you correctly, but it sounds to me as if you'd like to use content-placeholders in your mastertemplates?

    If thats the case you add something like this to your master template:

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

    and then in your child template of the main template you add content to the placeholder, e.g. using

    <asp:Content ContentPlaceHolderID="Main_myContentPlaceHolder" runat="server">
    ...
    </asp:Content>

    >Tommy

     

     

  • tesuji 95 posts 139 karma points
    Dec 03, 2010 @ 19:23
    tesuji
    0

    Thanks for the responses. I'll check into these.

    The main template is actually already a child template. I guess I could put the submenu in a "grandchild" template?

    Can you have two contentplaceholders in a template? It already has one.

     

  • Tommy Poulsen 514 posts 708 karma points
    Dec 03, 2010 @ 19:33
    Tommy Poulsen
    0

    You can have multiple placeholders, yes - just make sure to use unique ID's

    >Tommy

Please Sign in or register to post replies

Write your reply to:

Draft