user752826
user752826

Reputation: 13

how to create a menu in html dynamically

I'm not sure if I am using the proper term when I refer to "dynamically. *

I want to have a simple, one level, menu displayed on all 80 pages of my site. The menu items will change periodically - new items added, some removed, etc... What is the best way to create this menu so I don't have to update all 80 pages? FYI: I'm not too knowledgeable in all the scripting languages. Thank you.**

Upvotes: 1

Views: 686

Answers (2)

Rich Bradshaw
Rich Bradshaw

Reputation: 72975

The simplest way is to use PHP.

Name all your files so they end in php instead of html, and make a file called menu.php.

Copy your menu into menu.php, then no your other pages where you want the menu, type:

<? include("menu.php"); ?>

and the menu will appear like magic!

I would also suggest SSI, but they are often disabled on shared hosting in my experience.

Upvotes: 1

slandau
slandau

Reputation: 24052

Create a master page if your working in any one of the "major" web frameworks. You put a lonely HTML tag up there so I'm not sure if this NEEDS to be purely HTML and nothing else.

Upvotes: 0

Related Questions