Skip to main content
Participant
July 20, 2021
Question

How to repeat the header, menu and footer on each page with DW?

  • July 20, 2021
  • 5 replies
  • 4459 views

Hello,

I am new to DW and I would like to keep the same header, menu and footer identical on each page, in fact only the content (body) of the page should change.

 

Should we copy on each new page (the header, nav, footer, ...) parts !!! : -0 or is there a simpler and faster way on DW directly to be able to do it ??

 

Rem: I believe there is an include command (but if I understand correctly then I have to use some PHP: - ((which I would like to avoid ..)

 

thank you so much

 

This topic has been closed for replies.

5 replies

Nancy OShea
Community Expert
Community Expert
July 20, 2021

Hi @Phil5E57,

First, a couple of question to think about.

1. How big will your site be  -- under 10 pages, under 50 pages, more than 50 pages?

2. How often will you be updating your site?

3. Will your site be static HTML pages or dynamically driven with content pulled from databases?

 

=============

OPTION 1 (BEST):

Server-side includes (SSI).  Very flexible.  Works with small, medium and large sites, static or dynamic.  In the long-run, this method will save you the most time with the least amount of trouble.  Works with any code editor.  Edit one file, save & upload to server.  That's it.  All the magic happens on the server.

https://alt-web.blogspot.com/2015/07/server-side-includes-with-php.html

 

OPTION 2:

Dreamweaver Templates.  Semi-flexible.  A proprietary feature requiring more time and more trouble to update your site than SSIs. DW Templates only work in Dreamweaver on your local site files. You must republish your entire site to server each time you update.  Suitable for small  - medium sites.  On larger sites, Template.dwt files can become corrupted.  Keep reliable template backups on your server just in case.

https://helpx.adobe.com/dreamweaver/using/dreamweaver-templates.html

 

OPTION 3:

Library Items.   Least-flexible.  As with DW Templates above, a proprietary feature requiring more time and more trouble to update your site.  Library Items only work in Dreamweaver local site files and only inside the <body> tag.  You must republish your entire site each time you update. Suitable for small  - medium sites only.  Library Items can be glitchy and are often prone to failure. You may need to re-create them from time-to-time.

https://helpx.adobe.com/in/dreamweaver/using/library-items.html

 

[This discussion is locked. If you still have questions, please start a new topic. Thank you.]

 

Nancy O'Shea— Product User & Community Expert
B i r n o u
Legend
July 20, 2021

depending on the complexity of your web site, the period of content update, and the total number of page, ... running Templates, as suggest you @BenPleysier is a nice way to go.

Legend
July 20, 2021
quote

Templates, as suggest you @BenPleysier is a nice way to go.


By @B i r n o u

 

Seriously.......I think most who have been around for longer than a couple of years doing this have moved to better, more stable solutions. Almost every time I did use DWT templates, a long, long time ago, there were occasions when they failed to update a certain page or two to which the template was attached ending up in having to detach the template to do anything and then the 'link' was broken and repairing it wasnt that easy.

 

DWT template files are for beginners developing static pages and websites with a limited number of pages. Once you discover better options you'll kick yourself that you hadn't used them earlier.

 

Not even Ben uses DWT files these days.

 

Legend
July 20, 2021

Php includes is your best option.

 

Dreamweaver templates are a propriotary workflow in Dreamweaver which can easily become corrupt in my experience. You will also have to upload each page of your website when you update the template, which could be an uneeded irritational as your website grows. So best avoided where possible unless your website is only going to be a handful of static pages.

 

Javascript would be your second best option, as unlike php, it requires no server set up if you intend to work locally.

Nancy OShea
Community Expert
Community Expert
July 20, 2021
quote

Javascript would be your second best option, as unlike php, it requires no server set up if you intend to work locally.

=======

Right.  JS includes are OK but not 100% reliable.  There will always be some outliers with client-side script-blockers who can't see them. 

 

When a foolproof solution is essential for everyone, server-side includes are numero uno.

 

After the local testing server is installed and defined (5 minute set-up), it's smooth sailing from there.

- Wamp server  - https://www.wampserver.com/en/

- Xampp server - https://www.apachefriends.org/index.html

- Mamp or Mamp Pro server - https://www.mamp.info/en/downloads/

 

Set-up Localhost in Dreamweaver

https://helpx.adobe.com/dreamweaver/using/set-testing-server.html

 

Nancy O'Shea— Product User & Community Expert
Legend
July 20, 2021
quote
quote

Javascript would be your second best option, as unlike php, it requires no server set up if you intend to work locally.

=======

Right.  JS includes are OK but not 100% reliable.  There will always be some outliers with client-side script-blockers who can't see them. 

 

 

I dont concern myself about the handful that turn off/block javascript - vue, react and the rest of those websites built with modern front-end javascript frameworks simply wouldnt function. 

Known Participant
July 20, 2021

I know you say you prefer not to use PHP. But at its most basic the php required to do this is very simple.
All you need to do is:

1. Change the suffix of the page from .html to .php but it will till recognise the usual html.
2. Insert the following line the html eg for a footer:
<?php include_once('includes/footer.php') ?>
(includes/footer.php is the relative path and file)create eg footer.php but write it the same as though you are writing html.
Now if you want to change anything in the future you only have to alter one file, eg footer.php. Or if you want to add another menu item in the future.

And that is only the start of what you can do. If you wanted to look into it further you could use php so that the menu tab of the current page had different .css settings.

I don't know about templates though, so that may suit your needs better.

BenPleysier
Community Expert
Community Expert
July 20, 2021
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!