Forum Moderators: open

Message Too Old, No Replies

Inserting a Menu

         

reddevil

11:40 am on Feb 8, 2004 (gmt 0)

10+ Year Member



Hi,
Apologies in advance for this question - I am obviously missing something somewhere and I guess this is very basic!

I want to add a menu at the bottom of my Home Page "index.html" and I have allocated one Row specifically for this purpose.

Then I created a page called "menu.html" which includes all the Links as per the following html:-

<body>

<a href="index.html">Home Page</a> <a href="about.html">About Us</a> <a href="content.html">Content</a>

</body>

My question is, what basic Command do I need to use to get the "menu.html" page to appear in the bottom Row of my Home Page? without having to type all the <a href...............etc etc in the html on every single page?

Thanks.

smokeyb

1:51 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



I don't understand why you have a seperate page for your links? If they're are going to be on a different page. Why don't you just copy the code with the links and paste into each page, shouldn't take long. I once had a thin table divided up for each relative link, and just copied the whole thing to the bottom of every page I created.

balinor

1:55 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



Hi reddevil. It sounds like you are thinking of a frame of some sort. But why not just copy/paste all of the info onto each page? Do you plan on updating this link list a lot or have hundreds of pages? You could try an iframe, it would look something like this:

<iframe src="menu.html" name="menu" scrolling="no" frameborder="no" align="center" height="25" width="100%"></iframe>

reddevil

2:08 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



smokeyb
The reason for wanting a different page is so that the amount of html is kept to a minimum and because I have approx 50 pages (at the moment) I do not want to change/add to this every time a new page is added.
I had been using FP2000 but that inserts non-validating <nobr> tags that are impossible to get rid of (with FP).

balinor
Yup, that is the kind of thing that I am looking for - is this "frames"? My site currently uses html and css only as I read that "frames" is not a good idea because the bots don't like it. But it is on the right theme.

balinor

2:14 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



From what I have read on this forum (as well as personal experience), an Iframe works well with all browsers (except Netscape 4 which I will get to in a minute), and doesn't 'trap' you in the first page of the site. The only disadvantage of an iframe (as far as I can tell) is that the user will not be able to bookmark the specific content of the Iframe, just the page the iframe is in.

Now back to the Netscape 4 workaround. N4 uses the 'layer' command instead, so when setting up your iframe it should look like this:

<iframe src="menu.html" name="menu" scrolling="no" frameborder="no" align="center" height="25" width="100%"><layer src="menu.html></layer></iframe>

Sorry, should have put that in my original post!

smokeyb

2:16 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



An iframe is an inline frame, not the same thing as frames (search this forum for info on iframes). You must have many links for it to bloat the html enough to worry about though, how many are you talking?

reddevil

3:13 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



Thanks for the info again guys.
I have just converted to CSS and reduced my pages from 25k to 8-12k so I was hoping to reduce them even more.
I have two menus (left and bottom) with approx 20 links on each but it is the 50 or so pages that I don't relish the prospect of changing everytime that I want to add another page or change the order of links.
Is it standard webmaster practice just to put the Links within the html of every page?
Previously I had used Page Insert with FP2000 and changing the menu took about 1 second in total - but it puts in <nobr> tags which cannot be deleted.

encyclo

3:26 pm on Feb 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Forget iframes or cut-and-paste - what you need is a Server-Side Include (SSI). You can do a search on these boards, and there are a ton of threads on SSI. They are transparent to end users (so it doesn't matter what browser you're using) and enable you to update the menu on every page by editing one file. Basically, you put your menu fragment in a file called, say, menu.inc. Then you add the following to your pages:

<!--#include virtual="menu.inc"-->

The only disadvantage is that you may need to rename your files with an .shtml extension depending on your server's configuration (there are ways of getting round this, however).