Copied to clipboard

Flag this post as spam?

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


  • Cláudio Pinto 1 post 21 karma points
    Jun 24, 2011 @ 22:00
    Cláudio Pinto
    0

    including template

    good afternoon.

    I'm wondering, is it possible to insert a sub template on a base template?

    Imagine the following scenario...

    - Base template A
    - Base template B
    - Child Template to insert in "Base template A" and "Base template B"

    how can i put "Child Template..." inside the other two?

    Thanks in advanced

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jun 24, 2011 @ 23:57
    Kim Andersen
    0

    Hi Cláudio and welcome to the forum

    Yes, you can do this.

    When you click on the "Child Template", you can select the "Base template B" as the Master template in the dropdown menu in the top of the editor. When you have done this, you need to create a content area placeholder on your "Base template B". A  content area placeholder looks something like this:

    <asp:ContentPlaceHolder runat="Server" ID="yourIdHere">
    </asp:ContentPlaceHolder>

    Then in your Child template you must create a content area. You can do this by inserting a snippet like this:

    <asp:content ContentPlaceHolderId="yourIdHere" runat="server">
    <!-- Your markup, macros, content etc. here -->
    </asp:content>

    This will make sure that the content inside of the content area will be loaded inside of the content area placeholder. You can have all of the placeholders and content area blocks that you want, so just knock yourself out :)

    I hope the above makes sense to you.

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft