HTML code advice

Associate
Joined
15 May 2006
Posts
389
Hi all,

Just a quick one, im using dreamweaver for a html site. The site will have a lot of pages, however once the site is built and i decide to add a link into the footer of the page for example, I just want to change it once and the change go throughout all pages, not have to edit each page manually.

Is there a way I can do this? Like an include footer.html or something?
 
Mattw said:
Hi all,

Just a quick one, im using dreamweaver for a html site. The site will have a lot of pages, however once the site is built and i decide to add a link into the footer of the page for example, I just want to change it once and the change go throughout all pages, not have to edit each page manually.

Is there a way I can do this? Like an include footer.html or something?

Assuming your host is PHP enabled. Change the file type to .php then where you want your footer add

Code:
<?php include('./pathtofooter/footer.html'); ?>

Even though its a PHP file, only bits of it inside the <?php ?> tags will be parsed as PHP so you don't have to change anything.

I think you can also do this with HTML like this
Code:
<!--#include FILE="footer.htm" -->

But it requires some sort of server plugin.
 
If you're not sure if your host has php then you can use Dreamweaver templates. Set up a template how your pages are going to look and then create the pages based off that template. If you then go back and decide to change the footer at some point you just update the template and DW will go off and update all your pages for you.
 
JimmyEatWorms said:
If you're not sure if your host has php then you can use Dreamweaver templates. Set up a template how your pages are going to look and then create the pages based off that template. If you then go back and decide to change the footer at some point you just update the template and DW will go off and update all your pages for you.

That sounds like the better option. Yes i am using dreamweaver, however this is the first time i have ever used it.

Could you give me more specific instructions on this? sounds perfect for what i need
 
I believe it's File > Save As Template...

but i think you need to create editable regions - these are the regions which will be used for updating the duplicated content... I haven't actually looked into this much and never really used the feature but i think that's on the right lines.
 
Mattw said:
Hi all,

Just a quick one, im using dreamweaver for a html site. The site will have a lot of pages, however once the site is built and i decide to add a link into the footer of the page for example, I just want to change it once and the change go throughout all pages, not have to edit each page manually.

Is there a way I can do this? Like an include footer.html or something?

was just about to ask the same question. im glad ive read through the previous threads. is there no way to achieve this with just html ?

ie. i found i could do this with javascript. create a .js file with the content i wanted to include, then add ;

<SCRIPT language="JavaScript" src="content/menu.js">

this would then include woteva i create in the external menu.js file i create, then i add that link to all pages that i want the menu on, then i am able to dynamically update all pages at once. the reason i ask is im just trying to use notepad while im learning. and this javascript gives me that stupid information bar everytime i open the page. and i dont want that
 
If your server supports SSI (server side includes, most hosts allow it) then use it:
Code:
<!--#include virtual="path/to/file.html" -->

If not, try PHP, as mentioned in a previous post.


No offence to Jaffa, but avoid JavaScript for this problem if at all possible. JavaScript should not be used to generate standard page content, as some clients don't support it / have it disabled.
 
LazyManc said:
If your server supports SSI (server side includes, most hosts allow it) then use it:
Code:
<!--#include virtual="path/to/file.html" -->

If not, try PHP, as mentioned in a previous post.


No offence to Jaffa, but avoid JavaScript for this problem if at all possible. JavaScript should not be used to generate standard page content, as some clients don't support it / have it disabled.

I know what you mean and I personally would never use it. Just trying to answer the question :D :D No offence taken, im just a n00b ;)
 
Back
Top Bottom