Hi all,
What I am trying to achieve, but have no idea how to go about it, is
I want to use a template banner/navbar/ that I have created myself for all pages on my site.
Is it possible to add a "include file" into my html pages so that if I need to change one thing on the navbar or banner page I should only have to do it once via the template page instead of having to do it on every page in the website.
I am hoping to do this without using a database or frames, maybe using javascript instead.
I am using dreamweaver 8 to create my site and I wanted to first get this right before I get on with the whole site.
I was also hoping to make the page load quicker by achieving this, so that it looks as though only the content is changing......
I am not sure how to go about this ....
Can anyone help me out by maybe shooting me in the right direction with some javascript code....where to place it and the call function to achieve it..
Do I have to save the template file as a js file??
Anyway I will leave it out there and see what you guys can come up with for me....
Thanks
Vick
Hi there.
All solutions for your problem listed below seem to be OK, however, the easiest way to do it is using css. If the banner you want to place shows the same way on every page, you should just make something like this :
<div id="banner"> </div>
and add the following css to an external file
#banner {
width=banner width;
height=banner height;
background-image: src"path/to/your/banner.jpg";
backgrount-repeat: no repeat;
}
then just copy the <div> element on every of your pages.
The second way is to create a template in dreamweaver. Dreamweaver has its own template engine, so once you setup your template and apply it to all of your pages, once you change the template, all your pages will update.
If you don't know how to do a template, there is a tutorial in Dreamweaver and it is really good and simple.
The last option is using javascript or php to set it up, however I see that other guys have already explained it.
Good luck!