Click to See Complete Forum and Search --> : How to re-use a banner on subsequent pages.


Colm Delaney
10-12-2009, 10:40 AM
I am developing web pages using Dreamweaver.

The website will contain 6 pages all of which will display the same banner \ header image.

I have been told that I can save the banner in one htm file and reference it is my 6 other pages. Through doing this if I need to change the banner, I can just update banner.htm

Does anyone know how exactly to do this.

Thanks in advance.

ryanbutler
10-12-2009, 10:49 AM
You can create a server side include with the image in it, and then call that from each page. The server side include file is just a PHP file or an SSI file.

Colm Delaney
10-12-2009, 11:25 AM
Thanks Ryan.

banner.gif

On my 6 html pages do I leave an empty cell for where I want the image to appear.
Then click in the cell and in my code type in an include for banner.gif

I dont know the syntax for writing the include line.

How should I write the include line ?

Thanks in adance.

kiwibrit
10-13-2009, 04:07 AM
Google server side include. Note that you will either have to change your web page file extension to be shtml, or set up .htaccess to parse shtml as html. All this assumes you are using an Apache server. If you are using a Windows server and asp.net, the easy thing to do is to set up a MasterPage with your banner.

davedechant13
10-13-2009, 09:50 AM
Just another thought, and depending on which version of Dreamweaver you are using, but it's very easy to create a page and save said page as a template in Dreamweaver. Then simply go to file>new and create a new page from said template. You can make certain areas of the original template editable so that you can change them on each new page you create from the template, and the areas you do not make editable in the template can only be changed in the template, but the changes will show up on every page you created from that template.

Hope that wasn't too confusing because it's actually quite simple. I would just google something like, 'creating templates in dreamweaver'.

Hope that helps!

donatello
10-13-2009, 10:17 AM
Look up more on PHP include, but here's all you do in a nutshell:

<html>
<body>

<?php include("banner.htm"); ?>
<h1>Welcome to my home page!</h1>
<p>Some text.</p>

</body>
</html>


Save the above as test.php in the same directory as banner.htm on your server and then load the page.
Of course, you make a snippet of code called banner.htm which contains your header.

If you are new to PHP, remember, it will not work locally, but it must be uploaded to a PHP capable server.
GoDaddy: If you are using godaddy for hosting, it can be tricky... so if that doesn't work just add php5 to the end of your file name to force it to the latest version as older GoDaddy accounts run PHP4.x.x (test.php5).

View the source on your finished file to make sure you are not doubling tags...

EG
</head>
</head>

...etc.

charlitos
10-14-2009, 11:33 AM
Look up more on PHP include, but here's all you do in a nutshell:

<html>
<body>

<?php include("banner.htm"); ?>
<h1>Welcome to my home page!</h1>
<p>Some text.</p>

</body>
</html>


Save the above as test.php in the same directory as banner.htm on your server and then load the page.
Of course, you make a snippet of code called banner.htm which contains your header.

If you are new to PHP, remember, it will not work locally, but it must be uploaded to a PHP capable server.
GoDaddy: If you are using godaddy for hosting, it can be tricky... so if that doesn't work just add php5 to the end of your file name to force it to the latest version as older GoDaddy accounts run PHP4.x.x (test.php5).

View the source on your finished file to make sure you are not doubling tags...

EG
</head>
</head>

...etc.

What Donatello said, just use a php based template. As he already mentioned you will not be able to run php scripts without a webserver and php installed. But if you need something fast, just download WAMP(Apache, MySQL, PHP), install it and youre ready to go, then you will be able to see how your pages render without uploading files to your webserver.

here is the link to get wamp : http://www.wampserver.com/en/