none
Can I nest Dynamic Web Templates? RRS feed

  • Question

  • I have a site where some pages have header / sidebar / footer (HSF) and others with just header / footer (HF). So ideally I would like to make a HF.dwt and base a HSF.dwt on my HF.dwt. How do I do this? It is not at all clear from the menu functionality.

    Thank you

    David

    Sunday, November 27, 2011 11:34 PM

Answers

  • "I am a bit concerned about TAG=BODY, as this is only a html snippet that has no reference to BODY"

    The Design Time Include file must be a complete HTML page (with .htm or .html extension). This means the page must have all the elements a complete page has:
    <html>
    <head>
    </head>
    <body>
    included content
    </body>
    </html>

    The include picks up everything between (not including) the <body>...</body>, and ignores everything else. The <head> section can be left empty.

    On the other hand a Server Side Include (SSI) file only has the included content, and nothing else at all.


    Ron Symonds
    Microsoft MVP (Expression Web)

    www.rxs-enterprises.org/fp
    • Marked as answer by dlacey Monday, November 28, 2011 9:00 AM
    Monday, November 28, 2011 8:26 AM

All replies

  • That's because it is not recommended. I don't recall ever seeing it specifically said anywhere that you should not nest DWTs, but doing so isn't documented, and I've seen others recommend against it. The fact that it is not documented tends to indicate that it is not a process that the developers planned for, and given the nature of DWTs, and the commenting system that makes them work, I certainly wouldn't want to try it.

    There are methods that you could use employing include files, and another thing that you should consider is that DWTs are suited mainly for relatively small sites, since every single file using the template must be updated and republished when changes are made. For larger sites, server-side technologies are better suited.

    cheers,
    scott

     


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.
    Sunday, November 27, 2011 11:50 PM
  • Not reliably.  It isn't officially supported, and can have unpredictable results.

    You can use includes, either design-side or server-side for sections of content that appear in some pages but not in others.

    Sunday, November 27, 2011 11:52 PM
  • Shame - nested DWT would be an elegant solution, but including the sidebar into an editable region will work fine in my case.

    Thank you both for a prompt reply

    David

    Monday, November 28, 2011 12:42 AM
  • OK, the logic is all worked out, but the included html displays in design mode in EW4 fine, but NO SHOW on F12 in the browser. The included file is in the same directory as the displayed page but nothing happens!

    The include code is <!--webbot bot="Include" TAG="BODY" U-Include="sidebar.html" -->

    Is there an extra step I need to be aware of?

    (I am a bit concerned about TAG=BODY, as this is only a html snippet that has no reference to BODY)
    Monday, November 28, 2011 1:39 AM
  • You don't have metadata turned on in your site settings.  Do so, then preview it.  You need metadata for EW to maintain certain features regarding connections among pages, including design side includes.

    Monday, November 28, 2011 2:21 AM
  • In addition I'd recommend going to Site > Site Settings and under preview select the radio button to use the preview server for all pages not just php and asp.net. This puts everything in the internet zone sandbox and helps the browser understand root reference links better.
    Free Expression Web Tutorials
    For an Expression Web forum with without the posting issues try expressionwebforum.com
    Monday, November 28, 2011 2:50 AM
  • DWT's can be practical for fairly large sites in some cases. We have a site for one company that has several product lines and sub groupings for each line. In this case they wanted an identity for each group with differing grahics of the products in a common header design. This resulted in a larger number of DWT's so that changes made to a given grouping resulted in publishing only the DWT (and pages) for that group. The site has over 400 pages now.

    This would not have been the best choice after the fact, but as the site grew (and it was started with DWT's) it ended up this way. That along with several include pages has worked out well and show me that this is one way to manage a larger site without server side processing. Not the most efficient but certtainly workable.

    With include pages you can get the same effect you were looking for and when you want to edit the includes its as easy as editing any other page.

     

    Monday, November 28, 2011 2:50 AM
  • You don't have metadata turned on in your site settings.  Do so, then preview it.  You need metadata for EW to maintain certain features regarding connections among pages, including design side includes.

    Under Site Settings the "Maintain the site using hidden metadata files" check box is ticked and grayed out, presumably because it is a subsite of 'My Web Sites'. The code on the browser has 

    <!--webbot bot="Include" TAG="BODY" U-Include="sidebar.html" startspan --><!--webbot bot="Include" endspan i-checksum="0" -->
     

    embedded, so my webbot is partly ignoring me? And I have told the Development server to run on all pages (thanks Cheryl) but still a blank sidebar.

    Monday, November 28, 2011 3:29 AM
  • Thanks for that. This is only a small site - max 20 pages - but the content changes regularly.  DWT and includes should be fine for this application, if I can get it to show in the preview!
    Monday, November 28, 2011 3:31 AM
  • Since I have no problems getting includes to work in an EW subsite, I can't make any guess as to why it's not working for you.


    • Edited by KathyW2 Monday, November 28, 2011 4:47 AM
    Monday, November 28, 2011 4:46 AM
  • I could, of course, suggest running FPCleaner, in case the metadata is corrupted.

    Monday, November 28, 2011 7:16 AM
  • "I am a bit concerned about TAG=BODY, as this is only a html snippet that has no reference to BODY"

    The Design Time Include file must be a complete HTML page (with .htm or .html extension). This means the page must have all the elements a complete page has:
    <html>
    <head>
    </head>
    <body>
    included content
    </body>
    </html>

    The include picks up everything between (not including) the <body>...</body>, and ignores everything else. The <head> section can be left empty.

    On the other hand a Server Side Include (SSI) file only has the included content, and nothing else at all.


    Ron Symonds
    Microsoft MVP (Expression Web)

    www.rxs-enterprises.org/fp
    • Marked as answer by dlacey Monday, November 28, 2011 9:00 AM
    Monday, November 28, 2011 8:26 AM
  • Thanks Ron for picking up that comment of mine - that was my problem! Now all fixed - I knew it had to be something simple. Woulod be good to include that in the documentation...

    Thanks again for your eagle eye

    David

    Monday, November 28, 2011 9:00 AM