2 replies [Last post]
somecallmejosh
somecallmejosh's picture
User offline. Last seen 7 years 4 weeks ago. Offline
newbie
Joined: 2005-04-25
Posts: 7
Points: 0

Question...

I've created a style sheet for a website that contains 20+ webpages... How can I set my menu up to be referenced in my code, as they do with javascript menus so that I only have to update one menu...cascading down to all webpages, as opposed to updating the menu on every single page? Any help will be greatly appreciated.
_______________________________________________
My menu style is as follows:
p.menu {
position: absolute;
left: 5%;
right: 5%;
width: 95%;
height: 50%;
border: 1px solid #9999CC;
background-color: whitesmoke;
font: 12px Arial;
padding-left: 10px;
padding-right: 4px;
padding-top: 4px;
padding-bottom: 4px;
}

div.menu {
position: absolute;
background-color: white;
top: 220px;
left: 20px;
height: 400px;
width: 200px;
border-style: none none none double;
padding-left: 6 px;
}

______________________________________________
My menu is as follows:
<div class ="menu">
<p class="menu">
<a href="home.htm"><strong>Home</strong></a>
<br>
<a href="#"><strong>Tests and Services</strong></a>
<br>
<a href="fw.htm"> &nbsp; &nbsp; &nbsp; - &nbsp;Fresh Water</a>
<br>
<a href="sw.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Salt Water</a>
<br>
<a href="pw.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Produced Water</a>
<br>
<a href="cts.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Chemically Treated Seawater</a>
<br>
<a href="og.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Oil & Grease</a>
<br>
<a href="biodeg.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Biodegradation</a>
<br>
<a href="consulting.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Consulting</a>
<br>
<a href="dmr.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Discharge Monitoring Reports</a>
<br>
<a href="sr.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Shipping & Receiving</a>
<br>
<a href="#"><strong>About Us</strong></a>
<br>
<a href="hx.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Company History</a>
<br>
<a href="org.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Organizations</a>
<br>
<a href="award.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Achievements</a>
<br>
<a href="community.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Community Involvement</a>
<br>

<a href="#"><strong>Certifications</strong></a>
<br>
<a href="NELAP.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;NELAP</a>
<br>
<a href="LADEQ.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;LELAP</a>
<br> <a href="employ.htm"><strong>Employment</strong></a>
<br>
<a href="contact.htm"><strong>Contact</strong></a>
<br>
<a href="personnel.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Key Personnel</a>
<br>
<a href="maps.htm"> &nbsp; &nbsp; &nbsp; -&nbsp;Maps</a>
<br>
<a href="links.htm"><strong>Industry Links</strong></a>
</p>
</div>

rmfred
rmfred's picture
User offline. Last seen 13 weeks 8 hours ago. Offline
rank Elder
Elder
Timezone: GMT-7
Joined: 2004-01-31
Posts: 1073
Points: 31

Cascading Menu

Search the forum or google for "server side includes"...
This has been discussed a few time on this forum

www.powerbitwebdesign.com Powerbit your custom web design company

Sommunist
Sommunist's picture
User offline. Last seen 7 years 3 weeks ago. Offline
newbie
Timezone: GMT-5
Joined: 2005-04-30
Posts: 6
Points: 0

Cascading Menu

Forget SSIs, use PHP includes. Copy all of the code for your menu into a separate file and name it "menu.inc"

Then add this line into your webpage where the menu code used to be and save it as .php:
<?php include("./menu.inc"); ?>

If the .inc file isn't in the same directory, you'll have to add a path before it in the code. Also, if your server doesn't have PHP installed on it, this won't work.