View Full Version : menu without frames? am i that stupid?
steran
08-12-2002, 12:56 AM
OK, I give up. I feel like an absolute retard for asking this question, so feel free to rag on me a bit before helping me out.
I've always done menus on my site using frames. I KNOW there has to be a way to do it without frames.
I've thought about copying my menu script to every single page of my site, but, well, there just has to be an easier way.
I'm using a javascript for my menus that I would like to have inserted into every page on my site. I'd like to place the menu on the left hand side of the page, and possibly place a smaller menu on the bottom.
Most sites I've seen do it without frames, and I'm confident there's a way around not copying all the script to every page.
Basically, I'm looking for a solution similiar to the Front Page 'shared border' feature (no, I don't use front page, but yes, I am still learning how to code).
Can anyone help me?
Thanks in advance!
oracleguy
08-12-2002, 01:06 AM
It's pretty simple to do. You just add something called a 'server-side include'. Which is a peice of code that tells your server to add in the contents of another file you specify before it the page is sent to the client. The person viewing the page is comply oblivious that your using it because you can't tell by viewing the source.
<!--#include file="yourfile.htm" -->
So just put that line whereever your want your menu code to go. And it makes it easier to update because you change the one menu file and it changes it for all the pages.
evetsnodrog
08-12-2002, 01:08 AM
Do you know any ASP? If you do, you can code the menu in an include file and simply include it on every page. Otherwise, if all of your pages are static, Copying & Pasting or using frames are the only way I can think of. Maybe someone else has another idea.
oracleguy
08-12-2002, 01:13 AM
Originally posted by evetsnodrog
Do you know any ASP? If you do, you can code the menu in an include file and simply include it on every page. Otherwise, if all of your pages are static, Copying & Pasting or using frames are the only way I can think of. Maybe someone else has another idea.
Thats exactly what i just suggested btw.
steran
08-12-2002, 01:20 AM
Thank you oracleguy. I created a test page, and tabled the site. I tried to include the code into one of the cells, but it didn't work. I'm sure I'm doing something wrong. I've published a test page if you want to look at it.
http://www.dotalot.com/test/testpage.htm
Is there some other code I need to put on the page so the server recognizes that as SSI? I apologize for asking so many questions, I just have no idea how to do this, lol.
thanks again:thumbsup:
Chicano
08-12-2002, 01:29 AM
First you need to know if your server supports SSI ... if it does, then it might only support it for files with the extention ".shtml".
So you will need to change the name of every page that has a "menu included" to have the extention .shtml . Change your test page's .htm to .shtml and see if it works. If it does, then that is your problem.
Also, if it is just a javascript, can't you use a javascript library?
Just save the javascript right into a new file, and call it menu.js or whatever (ending with .js) then wherever you want to place it, just add the code:
<script language="javascript" src="dirs/to/script/menu.js">
</script>
and then your menu would appear.
That should be supported everywhere.
steran
08-12-2002, 01:33 AM
Awesome thanks! that did it. I was just an idiot and called the file .htm instead of .shtml.
Thanks for the javascript option as well - I'll give that a shot, too. Will one of them be faster than the other?
Thanks everyone for your help :)
Chicano
08-12-2002, 01:47 AM
Glad to be of some use.
And they are not stupid questions :p
Anyway, I am not sure which would be faster... someone else whould have to answer that.
I like the SSI one more, since you can add more then just javascript. You can add webpages and lots of other things...
But the only problem here, is that you have to rename all your files to ".shtml" and all the links linking to them as well... also, since your menu is not in frames anymore, remember to not target them, since that will make everything be in a new window and such.
Good luck!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.