View Full Version : Is this possible?
justdawn
01-22-2008, 02:16 AM
I'm new to CSS but I'm learning :)
What I want to do is use CSS for a menu. But I want to edit the menu in one place and not on each page.
Currently I have used Example 4 on this page http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm
and I love it, but as I build the site and add more I don't want to edit each and every page.
Thanks for any suggestions.
Dawn
jscheuer1
01-22-2008, 03:33 AM
Nope. Css can't do that.
djr33
01-22-2008, 03:37 AM
It could be possible using an external .js file and writing it with javascript, but the best method is a server side include option, like using the include() function in PHP, or SSI, depending on what will be available on your server.
BLiZZaRD
01-22-2008, 03:11 PM
Well... if you use a completely CSS menu then all you have to edit is the CSS file... You can use images instead of text for the links, etc and you can call those images in the CSS file, wanna change the menu? make new pictures, and change it in the CSS.
A similar effect CSS only menu can be found here (http://www.cssplay.co.uk/menus/drop_line.html)
jscheuer1
01-22-2008, 05:45 PM
What about the links?
molendijk
01-22-2008, 10:15 PM
If you want to have the same tab menu on each page, you can use this (http://www.dynamicdrive.com/forums/showthread.php?t=28620).
Put the tab menu in 'menu.html'.
Arie Molendijk.
neasneap
01-22-2008, 10:29 PM
my man! i need something like that too and with your help i got it thanks.:)
jscheuer1
01-22-2008, 11:00 PM
That's still not css, and certainly not bulletproof - it requires javascript. The only really good way to do something like that at the moment is server side. xml/xsl works in all modern browsers though, and I am therefore excited about it, as it's both a fairly simple method and easily tested locally without any special setup compared to server side coding which is fairly complex and requires some sort of local server to test it locally.
howellsgs
01-22-2008, 11:20 PM
I'm new to CSS but I'm learning :)
What I want to do is use CSS for a menu. But I want to edit the menu in one place and not on each page.
Currently I have used Example 4 on this page http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm
and I love it, but as I build the site and add more I don't want to edit each and every page.
Thanks for any suggestions.
Dawn
I am guessing that you would like a modularized menu bar that you can simply create once and have it appear on every page that loads it??? You can easily implement an OOP style menu simply by creating the menu and save it as menu.php -
Now, you can load that menu into index.php by using readfile() or include() functions.
IE of index.php
<?php
<div>
/*
Read file menu.php from disk and output it to the screen
note: this method can be used to read-in text files and
other web-pages as well without having to bother with
forms
*/
readfile('./menu.php'); //or include('./menu.php');
</div>
php?>
molendijk
01-22-2008, 11:23 PM
But Justdawn just wanted css for the menu!
The question how you can put the menu on every page is another matter.
Arie.
jscheuer1
01-22-2008, 11:27 PM
That's good, because it is server side. But it requires a PHP enabled server/host, and may or may not be as simple to implement as you indicate (depending upon the menu's and the server's requirements). If a PHP server/host is available and the code can be worked out, it is a very good choice.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.