webpages: how to create a 'fixed menu'

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
i recently started learning dreamweaver and i want to create a small test webpage but it's come to my attention that i only know how to implement the funcionality i want using frames (which is bad practice)

i want to have a fixed banner and menu and have links in the menu for the different sections of the webpage but don't want to reload the banner and the menu every time a link is created (that would happen if i'm using tables for the webpage layout).
frames is how i would have done this but i noticed a lot of websites do this differently (www.ikobo.com for example) and i can't seem to figure out how they do it...

any help is appreciated!! thanks!
 

iroast

Golden Member
May 5, 2005
1,364
3
81
You need something like PHP, or you can just use CMS (e.g., Joomla, Mambo).
 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
php eh? i was thinking more along the lines of javascript.... thx!
 

pstylesss

Platinum Member
Mar 21, 2007
2,914
0
0
If you venture into PHP, you will want to look at includes.

You can also look into AJAX, which is becoming more popular.
 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
Originally posted by: ZeroIQ
If you venture into PHP, you will want to look at includes.

You can also look into AJAX, which is becoming more popular.

yup that makes perfect sense and if i use php i can also make the text dynamic in the case of multiple languages too (pertaining to my other question on the forums)

ajax seems really promising but has quite a learning curve from what i understand and seeing as how i'm not at all proficient in xml that could be a problem...
thanks!
 

Kev

Lifer
Dec 17, 2001
16,367
4
81
Originally posted by: franguinho
php eh? i was thinking more along the lines of javascript.... thx!

look into using iframes with dhtml. i don't know what he's talking about telling you to use php
 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
Originally posted by: Kev
Originally posted by: franguinho
php eh? i was thinking more along the lines of javascript.... thx!

look into using iframes with dhtml. i don't know what he's talking about telling you to use php

thx!
 

pstylesss

Platinum Member
Mar 21, 2007
2,914
0
0
If you interested in having a page that works well with search engines, I believe iframes would not be your best option... but if not, then they are the simple, easy way to go.
 

Skeeedunt

Platinum Member
Oct 7, 2005
2,777
3
76
Originally posted by: franguinho
i want to have a fixed banner and menu and have links in the menu for the different sections of the webpage but don't want to reload the banner and the menu every time a link is created (that would happen if i'm using tables for the webpage layout).

If you mean you don't want to have to copy and paste the code at the top of a new html page you create (or have to apply a change manually to all pages) then using includes from any scripting language (PHP, .NET, whatever) or server side includes (for Apache or IIS) would be the thing to do.
 

cubby1223

Lifer
May 24, 2004
13,518
42
86
You don't need any server side scripting, they're making this way too complicated than it needs to me.

Just create the menu once, then put that html for the menu into a javascript file.

You have a file called menu.js, and in it you put
document.write('this is your menu with tables and links<table><tr><td><a href="doenvahea">envavnea</a></td></tr></table>');

If I'm understanding what you're asking, with your www.ikobo.com reference.

For instance, I've helped put together this site:
http://www.zeronine.com

The menu items are handled in one spot which spreads out to all pages. Also, the contact information at the bottom of the pages are also handled in one single spot. Like if I want to change the copyright to 2008 next year, I just change one digit and all pages are updated.

No server side scripting at all, just your fundamental html & javascript
 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
Originally posted by: cubby1223
You don't need any server side scripting, they're making this way too complicated than it needs to me.

Just create the menu once, then put that html for the menu into a javascript file.

You have a file called menu.js, and in it you put
document.write('this is your menu with tables and links<table><tr><td><a href="doenvahea">envavnea</a></td></tr></table>');

If I'm understanding what you're asking, with your www.ikobo.com reference.

For instance, I've helped put together this site:
http://www.zeronine.com

The menu items are handled in one spot which spreads out to all pages. Also, the contact information at the bottom of the pages are also handled in one single spot. Like if I want to change the copyright to 2008 next year, I just change one digit and all pages are updated.

No server side scripting at all, just your fundamental html & javascript

it seems to me that the whole site reloads each time you click any link... :confused:
what i'm looking for is for it to simulate frame behaviour so you click a link in the menu and neither the menu nor the banner get reloaded and the only thing that changes is the 'content' area...

here's another example:

http://www.global-money-transfer.com/

maybe i'm just being retarded and the whole page is loading too fast for me to notice... ????
 

cubby1223

Lifer
May 24, 2004
13,518
42
86
Originally posted by: franguinho
maybe i'm just being retarded and the whole page is loading too fast for me to notice... ????
bingo

Both example sites the full page refreshes with each click. Just depends how the browser transitions from one page to the next if you notice it or not.
 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
Originally posted by: cubby1223
Originally posted by: franguinho
maybe i'm just being retarded and the whole page is loading too fast for me to notice... ????
bingo

Both example sites the full page refreshes with each click. Just depends how the browser transitions from one page to the next if you notice it or not.

:p

thx
 

jjones

Lifer
Oct 9, 2001
15,424
2
0
Originally posted by: cubby1223
You don't need any server side scripting, they're making this way too complicated than it needs to me.

Just create the menu once, then put that html for the menu into a javascript file.

You have a file called menu.js, and in it you put
document.write('this is your menu with tables and links<table><tr><td><a href="doenvahea">envavnea</a></td></tr></table>');

If I'm understanding what you're asking, with your www.ikobo.com reference.

For instance, I've helped put together this site:
http://www.zeronine.com

The menu items are handled in one spot which spreads out to all pages. Also, the contact information at the bottom of the pages are also handled in one single spot. Like if I want to change the copyright to 2008 next year, I just change one digit and all pages are updated.

No server side scripting at all, just your fundamental html & javascript
Well, the only problem with that is that it relies on js. Not good if the site visitor has js disabled. But that's probably rare enough where it doesn't really matter. For myself, I try to rely on js as little as possible and if for some reason the user has it disabled, the site still works. Sucks that there's no standards a developer can rely on.

I still say php or other server-side scripting language is the way to go but that means learning it. But the good thing is, if you need to have the copyright date changed, you can program it automatically and you don't need to change anything yourself. :p

Edit, actually, you can do the same thing with js. :)
 

cubby1223

Lifer
May 24, 2004
13,518
42
86
By now I just assume everyone has cookies & javascript enabled.

And anyone who doesn't just cannot use the site. But that 0.00000001% is not enough to make me jump through hoops to accommodate them anymore. So much of the internet is already shut off to those few, what's one more site?

It's like making a site compatible with Netscape 4's layers. It's ridiculously impractical.
 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
don't use javascript to write html, especially if its navigation related.
this is 2007.

the javascript write should only be used as an absolute last resort

any server side scripting language that has includes will work
or as someone else mentioned SSI (server side includes, which oddly enough is different than the 'includes' from the server side scripting language)

if your host can't do at least one of the above, its time to find a new host.

figure out what you can use on your server, report back

don't worry about it loading everytime, browsers have cache for a reason
 

cubby1223

Lifer
May 24, 2004
13,518
42
86
Originally posted by: troytime
don't use javascript to write html, especially if its navigation related.
this is 2007.

the javascript write should only be used as an absolute last resort

any server side scripting language that has includes will work
or as someone else mentioned SSI (server side includes, which oddly enough is different than the 'includes' from the server side scripting language)

if your host can't do at least one of the above, its time to find a new host.

figure out what you can use on your server, report back

don't worry about it loading everytime, browsers have cache for a reason
I know this is throwing this thread off topic... but why do you say that?

Javascript is easy and it works. I do a lot of application work with ColdFusion, but I'm certainly not going to use ColdFusion scripts to put in little stuff like that. I'm not going to waste the server's processing time on something so trivial, I'm going to save it for the pages that actually need server processing. And the benefit is the site can easily be tested before uploaded.
 

jjones

Lifer
Oct 9, 2001
15,424
2
0
Originally posted by: cubby1223
Originally posted by: troytime
don't use javascript to write html, especially if its navigation related.
this is 2007.

the javascript write should only be used as an absolute last resort

any server side scripting language that has includes will work
or as someone else mentioned SSI (server side includes, which oddly enough is different than the 'includes' from the server side scripting language)

if your host can't do at least one of the above, its time to find a new host.

figure out what you can use on your server, report back

don't worry about it loading everytime, browsers have cache for a reason
I know this is throwing this thread off topic... but why do you say that?

Javascript is easy and it works. I do a lot of application work with ColdFusion, but I'm certainly not going to use ColdFusion scripts to put in little stuff like that. I'm not going to waste the server's processing time on something so trivial, I'm going to save it for the pages that actually need server processing. And the benefit is the site can easily be tested before uploaded.
Well, if you're coding correctly serving up an include like a menu is no more intensive than serving up the html really, no need to actually parse the html through php. You do have the benefit with js that the script will be stored client-side in cache, but still, server load is so minimal serving up a menu include that you don't even need to consider it. And running WAMP on your desktop is so easy these days there's really no reason not to be coding in an IDE environment, so testing and debugging is done before anything hits the server.

But I'm not trying to convince you, to each their own as I always say. As long as it works, that's all that counts. :)
 

pstylesss

Platinum Member
Mar 21, 2007
2,914
0
0
What you were originally asking for can't really be done, unless you use AJAX, which loads web pages in through the background... can you explain what you want to do again, so I can try to help you a little better?

If you want to speed up a website load time, using javascript will not benefit you, especially if it is poorly written.
 

Alex

Diamond Member
Oct 26, 1999
6,995
0
0
Originally posted by: ZeroIQ
What you were originally asking for can't really be done, unless you use AJAX, which loads web pages in through the background... can you explain what you want to do again, so I can try to help you a little better?

If you want to speed up a website load time, using javascript will not benefit you, especially if it is poorly written.

basically i wanted a solution to implement 'frames-behaviour' without actually using frames... for example: my page has a banner on top and a manu on the left and the main site text occupying the rest of the page and whenever the user clicks on any of the links only the content is changed, without having to reload the banner and the menu every time. exactly like frames.
 

troytime

Golden Member
Jan 3, 2006
1,996
1
0
Originally posted by: cubby1223
Originally posted by: troytime
don't use javascript to write html, especially if its navigation related.
this is 2007.

the javascript write should only be used as an absolute last resort

any server side scripting language that has includes will work
or as someone else mentioned SSI (server side includes, which oddly enough is different than the 'includes' from the server side scripting language)

if your host can't do at least one of the above, its time to find a new host.

figure out what you can use on your server, report back

don't worry about it loading everytime, browsers have cache for a reason
I know this is throwing this thread off topic... but why do you say that?

Javascript is easy and it works. I do a lot of application work with ColdFusion, but I'm certainly not going to use ColdFusion scripts to put in little stuff like that. I'm not going to waste the server's processing time on something so trivial, I'm going to save it for the pages that actually need server processing. And the benefit is the site can easily be tested before uploaded.

javascript is client side. which means if anything causes connections problems during the http load, that JS gets skipped
crawlers typically ignore javascript

but mostly its absolutely pointless and ridiculous, especially when it comes to editing.
wrapping everything in javascript write, that could potentially be a TON of extra code for a 'solution' that is originally intended on making the site faster?

a cfinclude uses very very little processing, probably about the same as the cold fusion parser would use parsing a cfm page with no cf tags.

you as a cold fusion programmer should see the light.
what do you do when you use cold fusion output in the navigation?
 

pstylesss

Platinum Member
Mar 21, 2007
2,914
0
0
If that's what you want, i think either iframes (bad choice) or a little AJAX (good choice) is your best bet. It wouldn't take too long to learn the little bit of AJAX required so you can do what you want.