homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

When I add a new page I have to change the menu on all pages

 4:18 pm on Dec 10, 2004 (gmt 0)

I'm pretty new to web desiging. When I add a new page to my website I have to go into every page and add the new page to the menu bar. I know there is a way around this. Can someone please help?



 4:41 pm on Dec 10, 2004 (gmt 0)

You need to place your menu bar either in an iframe or use server-side includes (SSI). Depending on site/menu design, iframes may not be suitable.

SSI is implemented by placing a special comment in the html. The server scans the page and inserts the required data (in your case, another file) each time the page is requested.

Typically SSI is enabled by using the filename extension .shtml however changing the file name may cause problems with search engines and backlinks. It can be enabled by editing the .htaccess file but that's another story.

<!--#include virtual="/menu.htm" -->

In the example above, menu.htm should be simply an html fragment (no <body> or <head> tags, etc.)



 4:44 pm on Dec 10, 2004 (gmt 0)

Another option (depending on how you build your sites) is to create a master template(s) that automatically updates the pages in your site when you change it. Most wysiwyg programs offer this feature.

Longhaired Genius

 5:08 pm on Dec 10, 2004 (gmt 0)

You don't have to link to every page from every other page on your website. Instead, link from every page to a page called Articles (or whatever) and link to all your content pages from there.


 4:04 am on Dec 11, 2004 (gmt 0)

There's yet another way to do this without SSI... although it follows along the same line as SSI.

Create a text file that contains the javascript to generate the HTML code for the menu. Call the javascript from some location on your web page... whereever it is you want the menu to print.

I once purchased some html templates from a company named allwebco and they did all their menus that way. It was very quick and convienient to make menu changes in one place and have all the pages updated. ...not to mention I didn't have to set up SSI.

Now that I know how to use SSI, I stopped using the java method. If your hosting provider does not do SSI you might consider the java alternative.

Let me know if you need examples.


 5:40 am on Dec 11, 2004 (gmt 0)

Just a note (picky but possibly important for some readers) that Javascript and Java are two very different technologies. Especially if you are researching on a search engine, be sure to keep the difference clearly in mind so you get the results you are after.

This is definitely a Javascript (created by Netscape) method. Java (created by Sun) is rarely used these days in HTML pages, but it is quite valuable on the server side because it allows you to work with data on different platforms.


 12:47 am on Dec 13, 2004 (gmt 0)

Working with templates works best for me. Change the template once, have all your pages update. Works well with dreamweaver, frontpage, others.


 1:01 am on Dec 13, 2004 (gmt 0)

Thanks everyone!
I used SSI.
Wow! Easier then I thought!
Thanks again!


 7:15 pm on Dec 25, 2004 (gmt 0)

SSI is quite easy to do. PHP also offers a similar functionality, but with lots more power in building dynamic content.

A note about the Javascript menu posted above: beware that those links will not be followed by search engines (and won't work for people that have turned javascript off)), so you'll need to link every page to a sitemap page where you list everything as normal links too.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved