Chris Frank
Chris Frank

Reputation: 4452

Update multiple pages

I am doing some freelance work for a client and I need to re-code an old menu. The entire site is static which will make this process extremely slow and redundant, does anyone have a good technique for updating multiple pages automatically?

The old developer used "Allwebmenus" which is a automatic menu creation tool. It is implemented by using JavaScript which writes HTML to the DOM. I'm going to replace this with a clean html menu and some simple jQuery.

Right now I think the best way is to create a separate .html file with the menu code, and use PHP includes on all the pages but this still requires me to update every page on the site. Can anyone give me better idea? Or do you think this is the best option?

Thanks for the help!

Upvotes: 0

Views: 279

Answers (3)

Giles
Giles

Reputation: 362

Using the PHP includes is a good method. If the "Allwebmenus" has Javascript code on each page, you'll have to edit each file anyways, so adding the includes is no big deal.

Upvotes: 1

Zack Tanner
Zack Tanner

Reputation: 2590

As far as fixing all the static pages, you will have to go in and do that yourself.

include("menu.html");

You can use includes, but it might also make since to put them onto a CMS like Drupal. Handles a lot of that for you.

Upvotes: 1

Husman
Husman

Reputation: 6909

create menu.php and include("menu.php") into each file where the old menu's are written. It will make your life easier going forward too.

Upvotes: 1

Related Questions