Skip to main content
Inspiring
December 8, 2019
Answered

Need help on nested templates

  • December 8, 2019
  • 2 replies
  • 6998 views
Please download the attached file to view this post
This topic has been closed for replies.
Correct answer BenPleysier

This may help you https://helpx.adobe.com/au/dreamweaver/using/creating-nested-template.html

 

Having said that, I have never used nested templates, but have heard of huge problems when implementing them. If you have a server side code like PHP, you would do yourself a favour using server side included (SSI). See https://www.w3schools.com/php/php_includes.asp for more.

2 replies

Nancy OShea
Community Expert
Community Expert
December 8, 2019

Nesting templates is never a good approach.  Sorry.  I can't recommend it.

 

The whole idea behind a DW Template is to create sitewide consistency.   In other words, the Template contains all sitewide elements such as header, navigation and footer with editable regions for content that changes from page to page.  Optional regions are for elements that may appear on some but not all pages.  This combined with a well-crafted external stylesheet gives you a firm foundation  for your entire website and represents about 80% of the initial planning & production phase.  The remaining 20% is just adding content to child pages.  Using more than one template per site just complicates matters and defeats the whole purpose of using a Template in the first place.

 

A Template is useful for small static websites of 20-50 pages.  But beyond that, you need to consider server-side technologies with content stored in reusable files such as SSIs (includes) and/or or an online database like MySQL.  One example of this would be a WordPress site.

 

 

 

 

Nancy O'Shea— Product User & Community Expert
linda_CGAuthor
Inspiring
December 8, 2019

I have never heard of SSI before.  

 

Nancy OShea
Community Expert
Community Expert
December 8, 2019

SSIs are a huge time saver and significantly reduce the amount of code in your parent pages.  For example, this php file is populated on the server with content from 6 server-side include files.  Each include file contains code for that particular section only  --  <head>, <header>, <nav>, <footer> and so on....

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Unique Page Title</title>
<?php include("ssi/head.html"); ?>
</head>
<body>
<div class="container">
<?php include("ssi/header.html"); ?>
<?php include("ssi/top-nav-search.html"); ?>
<?php include("ssi/ads.html"); ?>
<main class="row">
MAIN CONTENT GOES HERE....
</main>
<?php include("ssi/footer-text.html"); ?>
<?php include("ssi/footer-scripts.html"); ?>
</div>
</body>
</html>

To change sitewide navigation, open the include file, edit, save changes and upload to server.  Voila!  All site pages are updated.

 

If your server doesn't support PHP, you can probably use ASP or SHTML includes instead.  Ask your hosting provider.

 

Nancy O'Shea— Product User & Community Expert
BenPleysier
Community Expert
BenPleysierCommunity ExpertCorrect answer
Community Expert
December 8, 2019

This may help you https://helpx.adobe.com/au/dreamweaver/using/creating-nested-template.html

 

Having said that, I have never used nested templates, but have heard of huge problems when implementing them. If you have a server side code like PHP, you would do yourself a favour using server side included (SSI). See https://www.w3schools.com/php/php_includes.asp for more.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
linda_CGAuthor
Inspiring
December 8, 2019
I thought my problem was because the pages are all different in the body.

Get Outlook for iOS