PDA

View Full Version : Menu in an external file



anihee
09-15-2007, 04:12 PM
Hello all,

I'm still very new to CSS, just trying to work it out....:o

I want to put a drop down menue on my site and found on DD this one:

Chrome CSS Drop Down Menu (v2.01)
http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm

I've put it on one page, I've changed it in my editor and it works all very well.:) The menue itself refers to an external css-file - everything works fine.

BUT:
Since I'd like to use it as a navigation bar, I'd like to put the whole menue in an external file to which all the pages on my site will refer to, so when changing i.e. a submenue it will appear on all pages.

How has this file to look like?
What will I put in the <head>-section on my pages?

Hope you understand what I'm trying to ask......:o

djr33
09-15-2007, 04:39 PM
You could have an external .js file that generates the content, but that isn't how that particular script is setup.

I'd use PHP, myself.

<?php include('mymenu.txt'); ?>

that will print the contents of mymenu.txt into the existing html of the page.

Note that you need php installed/enabled on your server and your page must end in a .php extension.

anihee
09-15-2007, 04:46 PM
You could have an external .js file that generates the content, but that isn't how that particular script is setup.

I'd use PHP, myself.

<?php include('mymenu.txt'); ?>

that will print the contents of mymenu.txt into the existing html of the page.

Note that you need php installed/enabled on your server and your page must end in a .php extension.

Thanks, I see, I'd have to get into php as well.....Hoped to skip that, because I've just mastered HTML and a bit of CSS and my server doesn't support PHP.

So I have to put the menue description on every page until I start with php.