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.

B i r n o u
Legend
July 20, 2021

well, I know that you're not in favor of DWT. Well, for small web site, that doesn't need frequent update, and that doesn't rely on any databases... Templates as I said is a nice solution.

 

for info, when a child has its link corrupted with the template itself, just drag and drop the template on the child page rendering... and hop... it is instantly restored

BenPleysier
Community Expert
Community Expert
July 23, 2021
quote

As usual, you are being irrational in your discussions and this is turning into something that I do not stand for,

 

quote

 

Distancing ones self, yes, but from people who cant speak plain English and people who contradict themselves, could well be a saving grace.


By @osgood_

 

All I can say is, `va te faire foutre` and as I said before `distancing oneself from Dionysos, may be a saving grace`.


By @BenPleysier

 

LOL, now you ARE showing your true colors.

 

There's nothing irrational about my discussions. As you know very well I leave no stone unturned and don't suffer fools gladly.

 

As for being accused of becoming aggressive well you go beyond the pale in your very thinly disguised and veiled attempt to personally abuse me. I wont stoop that low though I'll leave that to you.

 

You're an absolute disgrace Ben and are not fit to represent Adobe and should be ashamed of yourself. If Adobe doesnt remove that obcene abuse then they are as bad as you.

 

Have a nice day yourself, maybe that is what you were really trying to say.


quote

You're an absolute disgrace Ben and are not fit to represent Adobe and should be ashamed of yourself. If Adobe doesnt remove that obcene abuse then they are as bad as you.


By @osgood_

 

That is an intersting take on what I said.

 

I have a feeling that you are turning "va te faire foutre" in a a literal translation instead of using the semantic shift of the meaning in the French language.

 

I guess fools will be fools and like you, I do not tolerate them.

 

I do not see an apology for your racist remark, which should most certaily be removed.

 

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
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!