Forum Moderators: not2easy

Message Too Old, No Replies

CSS drop down menu

         

csscuriosity

1:47 am on Jan 25, 2007 (gmt 0)

10+ Year Member



hi all,

i've been designing webpages using Dreamweaver. Every page has a drop down menu that is identical to all pages. So, if there's any change in the drop down menu, i'll have to update all pages. So, i thought about CSS just to hope it can help me eliminate the needs for updating all pages. So, my question is that CSS can create one (1) drop down menu for all pages and if updated, i would only have to update 1 drop down menu and the other pages should get the same change. thanks for your help.

mep00

4:31 am on Jan 25, 2007 (gmt 0)

10+ Year Member



No, css only defines how content specified in you document (e.g., an html file) should be presented; it doesn't define what that content is (there are some exceptions, but they aren't relevant to your question).

Besides making all the changes by hand, there are only two options, though there are many variations of each: developer tools applied before a page is saved on the server and by the server at the time of the page's request.

Developer tools would include multi-file search and replace or features built in to programs like Dreamweaver. These are fine if you're only dealing with a handful of static pages. However, if there many pages, this process becomes very cumbersome, and if the pages are dynamic, impossible.

The server based option includes things like server side includes, scripting languages (e.g., php, pearl), and content management systems (CMS). All three are pretty much the same: the page is assembled just before it's sent to the user (I'm ignoring caching for the sake of simplicity).

If you choose to use php, the code is very simple:
page.php:


<!DOCTYPE...
<html>
<head><title></title></head>
<body>
<?php include("nav.inc")?>
</body>
</html>

nav.inc:


<ul id="nav"><li><a href="#">link</a></li></ul>

And that's it (though feel free to embellish it a bit). Other than the doctype, the code is 100% valid and functional (even if it doesn't do very much).

BeeDeeDubbleU

9:06 am on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



IT depends on the size of your site but if you make the menu part of a DW template that all other pages are based upon they will be updated automatically whan a change is made.

csscuriosity

3:23 pm on Jan 25, 2007 (gmt 0)

10+ Year Member



thanks all for reply. Basically, we will design 1 DW template that has a drop down menu and use this page for about 20 pages that will have the same drop down menu. After that, if any change required, we'd need to modify the DW template? The question now is how to use this template for the second page and so forth?

Please advise. Thanks.

BeeDeeDubbleU

3:54 pm on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Every page has a drop down menu that is identical to all pages.

Second page?

cmarshall

4:31 pm on Jan 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may find this [thepattysite.com] enlightening.