8 replies [Last post]
bacchanal
Offline
newbie
Last seen: 14 years 6 weeks ago
Joined: 2006-06-21
Posts: 7
Points: 0

I'm working on a css layout and things are going pretty smoothly. However, is there a way to make a css menu that is somehow embedded into the style sheet or in an html template. I know how to make the standard css menu, but I don't want the menu to be a unique <ul> (or whatever) on every html page. I want it to work like a frame so that if I want to modify the menu for all pages, I can do it from one file.

Sorry I can't post my code right now, because it is on a local machine at work. I'm currently using css only (no frames, tables, or js). Also, I'm not using any sort of cms or db for this site.

Is there a way to do what I want to do? Can CSS do it? If not, any suggestions?

larmyia
Offline
Elder
London
Last seen: 11 years 46 weeks ago
London
Timezone: GMT+1
Joined: 2005-01-25
Posts: 1060
Points: 0

'modular' css menu

you can do it using SSI (server side includes). very simple to do. Just google.

this will be one file that you'll insert into every page, and therefore you'll only have one file to make changes to.

larmyia

bacchanal
Offline
newbie
Last seen: 14 years 6 weeks ago
Joined: 2006-06-21
Posts: 7
Points: 0

'modular' css menu

awesome, thanks for pointing a newb in the right direction!

bacchanal
Offline
newbie
Last seen: 14 years 6 weeks ago
Joined: 2006-06-21
Posts: 7
Points: 0

'modular' css menu

my life is forever altered...goodbye tables, goodbye frames!

larmyia
Offline
Elder
London
Last seen: 11 years 46 weeks ago
London
Timezone: GMT+1
Joined: 2005-01-25
Posts: 1060
Points: 0

'modular' css menu

bacchanal wrote:
awesome, thanks for pointing a newb in the right direction!

no probs. my pleasure. hard to know what to look for when you're not sure what it is Wink

bacchanal wrote:
my life is forever altered...goodbye tables, goodbye frames!

you won't regret it. that I can promise you.

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 3 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

'modular' css menu

i usually use

<?php include('nav.inc'); ?>

and make a nav.inc text file and put the nav there
then just rename your index.html to index.php and you are golden

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

bacchanal
Offline
newbie
Last seen: 14 years 6 weeks ago
Joined: 2006-06-21
Posts: 7
Points: 0

'modular' css menu

I have mainmenu.htm as my menu file and blahblah.shtm as my 'index' file with

#include virtual="/test2/ssi/mainmenu.htm"

Not sure if this is the best way to do it, but it works fine.

My (work) server doesn't have php, but it has ASP VBS, which I know very little about.

rmfred
rmfred's picture
Offline
Elder
Rock Springs, WY
Last seen: 1 year 43 weeks ago
Rock Springs, WY
Timezone: GMT-6
Joined: 2004-01-31
Posts: 1073
Points: 31

'modular' css menu

shouldn't that be
<include>

edit... it stripped out the code

<!--#include virtual="/test2/ssi/mainmenu.htm" -->

bacchanal
Offline
newbie
Last seen: 14 years 6 weeks ago
Joined: 2006-06-21
Posts: 7
Points: 0

'modular' css menu

yeah, it stripped out the code for me too...I removed the <--'s, but I guess it would have been better to use the code tag :roll: