English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Is there a way with css or any other code to make a website menu in one place so that I don't have to edit the code on all of my pages?

2006-12-05 05:42:37 · 5 answers · asked by klethag 2 in Computers & Internet Programming & Design

Is there a way with css or any other code to make a website menu in one place so that I don't have to edit the code on all of my pages?
I do not use dreamweaver or any other program - I do all the coding myself.

2006-12-05 05:52:19 · update #1

5 answers

Use simple external javascript file. That way all you have to do is edit the js file and it will change all the pages that it appears on.

Try this link........there's lots of help on javascript here

http://www.javascript.com/

2006-12-05 11:50:43 · answer #1 · answered by Elt 5 · 0 0

CSS will not do this. There are a few ways you can make this easy:
* Use a program such as Dreamweaver or GoLive, and put the menu in a template. That way you can update it globally. You can still do all the coding yourself -- just use the program for its template features. This is the approach I use.
* If your Web server supports SSI (server-side includes), you could put the menu in a separate document and include it wherever you want it.
* Instead of SSI, you could use a server-side scripting language such as PHP to include the menu.
* The JavaScript method that another poster described will work, but is risky. Among other things, it means that search engines won't be able to see the links contained in the menus, since they do not generally process JavaScript. This may make it more difficult for them to index your site.

2006-12-05 06:03:12 · answer #2 · answered by MarnenLK 6 · 0 0

A good program can do a "find and replace" if your menu's source code is the same through all of your pages.

Dreamweaver has this built in.

otherwise, if you use templates, you just make a modification to your template, and all your pages are affected.

2006-12-05 05:44:55 · answer #3 · answered by arus.geo 7 · 1 0

You can choose to use frames, but they are cumbersome. A way I recommend is to put this on each page, where you want the menu:



Then make a text file called menu.js that contains this:

document.write("<>");

It works on all browsers, but requires JavaScript to be enabled, so you should probably leave at least one link that isn't dynamically generated.

2006-12-05 05:47:23 · answer #4 · answered by jacinablackbox 4 · 1 0

as far as getting things from the internet, there is a nice command-line utility called cURL which grabs content from the internet. you can ouput it to console or use -o to output it to a file I think. check out the commandline switches using from a cmd shell curl --help | more I suggest you put the update in a batch file and when you run it, hide the window. then after you have downloaded the files, you can do whatever you want to run programs or whatever, but be sure to verify that your updates were successful. you might want to clean out the update directory before each run so you can verify the files all came through correctly. afterwards, you can run installers or programs that came through or whatever. that'll be $40 for the advice. :-) curl is free.

2016-05-22 21:34:44 · answer #5 · answered by Lynn 4 · 0 0

fedest.com, questions and answers