PDA

View Full Version : how do i??????


stakesbyarmskeane
07-30-2007, 02:00 PM
iv created a website
www.stakesbyarmsfc.co.uk/test/index.htm
and i want the menu to be changeable, so that when i update the menu, it changes on every page and not just the main page? how do i do that? as i use this as my template and whe i change it i dont have the varibales so it alters the tabls properties in every page?
thanks
chris

Mark_W
07-30-2007, 04:12 PM
Well I personally would do it like this:

Take the following code <tr bgcolor="#000000">
<td height="19" bordercolor="#000000" width="920" colspan="2">
<p align="center"><b><font color="#FF9900" face="Rockwell Condensed">&nbsp;&nbsp;&nbsp;
Home&nbsp;&nbsp;&nbsp; About Us&nbsp;&nbsp;&nbsp; History&nbsp;&nbsp;&nbsp; The
Squad&nbsp;&nbsp;&nbsp; The Opposition&nbsp;&nbsp;&nbsp; Match Reports&nbsp;&nbsp;&nbsp;
Results&nbsp;&nbsp;&nbsp; League&nbsp; Tables&nbsp;&nbsp;&nbsp; Top Scorers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></b></td>
</tr>
<tr bgcolor="#000000">
<td height="19" bordercolor="#000000" width="920" colspan="2">
<p align="center"><font color="#FF9900" face="Rockwell Condensed"><b>Gallery&nbsp;&nbsp;&nbsp;
Honours Board&nbsp;&nbsp;&nbsp; Fantasy Football&nbsp;&nbsp;&nbsp; Presentation
Night&nbsp;&nbsp;&nbsp; 100 Club&nbsp;&nbsp;&nbsp; Forum&nbsp;&nbsp;&nbsp;
Sponsors&nbsp;&nbsp;&nbsp; Links&nbsp;&nbsp;&nbsp; Contact Us&nbsp;&nbsp; </b>
</font></td>


</tr>(If you haven't noticed this is from your html code)

Then create a new php page and call it menu.php or whatever you want to call it, then past the code into that page and save it.

Then go back to the page you want the menu on and where the previous code was, insert the following:

<?php include ('menu.php'); ?>So for example

I am a piece of code, hello

<tr bgcolor="#000000">
<td height="19" bordercolor="#000000" width="920" colspan="2">
<p align="center"><b><font color="#FF9900" face="Rockwell Condensed">&nbsp;&nbsp;&nbsp;
Home&nbsp;&nbsp;&nbsp; About Us&nbsp;&nbsp;&nbsp; History&nbsp;&nbsp;&nbsp; The
Squad&nbsp;&nbsp;&nbsp; The Opposition&nbsp;&nbsp;&nbsp; Match Reports&nbsp;&nbsp;&nbsp;
Results&nbsp;&nbsp;&nbsp; League&nbsp; Tables&nbsp;&nbsp;&nbsp; Top Scorers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></b></td>
</tr>
<tr bgcolor="#000000">
<td height="19" bordercolor="#000000" width="920" colspan="2">
<p align="center"><font color="#FF9900" face="Rockwell Condensed"><b>Gallery&nbsp;&nbsp;&nbsp;
Honours Board&nbsp;&nbsp;&nbsp; Fantasy Football&nbsp;&nbsp;&nbsp; Presentation
Night&nbsp;&nbsp;&nbsp; 100 Club&nbsp;&nbsp;&nbsp; Forum&nbsp;&nbsp;&nbsp;
Sponsors&nbsp;&nbsp;&nbsp; Links&nbsp;&nbsp;&nbsp; Contact Us&nbsp;&nbsp; </b>
</font></td>
</tr>

I am also a piece of code, helloShould now be:

I am a piece of code, hello

<?php include ('menu.php');?>

I am also a piece of code, hello

Then save the page, remembering it has to end in a .php extension.

Then when ever you want to change the menu just open up menu.php and make the changes there.

davidj
07-30-2007, 05:39 PM
will only work if your in a PHP environment

here is an SSI

<!--#include file="footer.html" -->

Jittor
07-30-2007, 06:18 PM
I do this for my Nav, Footer, Header, and any other column I have. I find that it makes life so much easier. I do it for the header because I like to change it for the holidays, the footer because the copyright and/or links might change, same with the nav, and usually my third column because I have updates and links in that column.

But like DJ said, you need PHP support for what Mark gave you, but I have used both and they both work well.

DJ - Is there any downfall to one or the other?

davidj
07-30-2007, 06:22 PM
only the cost of requiring a host account with php support only to allow your includes to work.

a bit like using a saturn 5 in a firework display

Jittor
07-30-2007, 09:09 PM
I figured as much