Click to See Complete Forum and Search --> : Navigation without frames


ian
07-21-2003, 07:14 AM
Forgive me if this is an obvious question...

I have a site (with frames) which I've inherited and until now I have only edited content, and not navigation elements. I'm now redesigning it and am looking at changing navigation.

I see from browsing this forum that many posters are hostile to the use of frames for navigation and suggest that there are better ways of doing it. Can anyone outline for me what the alternatives to use of frames for site navigation are?

Thanks
Ian

DaveSW
07-21-2003, 08:15 AM
Well:

There's two main ones:

1) Tables - currently used by most people but they really are a BAD way to layout your site

2) CSS - you'll need to start at the bottom with this.

Go first to http://www.w3schools.com/css/default.asp Then if you do those tutorials you'll understand the next one.

http://www.thenoodleincident.com/tutorials/box_lesson/boxes.html will give you lots of the available layouts.

bookmark http://www.w3.org/TR/REC-CSS2/ as the definitive reference.


Do you want an explanation of why frames are bad?

dave

Charles
07-21-2003, 08:18 AM
Frames are more annoying than bad. The only real problem comes when a web author tries to use JavaScript to manipulate them. 13% of users do not use JavaScript and some of those good users cannot use it because of some disability.

And in case your pages get separated, make sure that everything can stand on its own. Put your navigation links along the bottom of your content pages as well and always give a link to the top frameset.

ian
07-21-2003, 08:54 AM
Dave

Thanks for the links - I'll check those out.

A brief explanation of the problems with frames would be useful.

Cheers
Ian

ian
07-21-2003, 11:43 AM
Also - the little I know about CSS was that it is about standardising style rather than content. So how do you work it so that every page in your site is displaying the same standard navigation content (i.e. the same links in the navigation bar)?

Cheers again
Ian

pyro
07-21-2003, 11:48 AM
To include content on each page, try using PHP or SSI includes:

.php
<?PHP
include ("file.htm");
?>

.shtml
<!--# include file="file.thm"-->

where file.htm is the content you want included...

DaveSW
07-22-2003, 04:47 AM
Originally posted by ian
A brief explanation of the problems with frames would be useful.


Charles explained most of it. At some stage you'll decide you need to change two frames at once, so you'll use javascript, and that means 13% of your audience can't read your page anymore.

The more practical side is that some browsers don't support frames. So you can provide a link in your <noframes> tags to your page inside your frames. The trouble is, most people use it to separate the menu from the content, so if you link to the content page, no menu. If you link to the menu, no content.

The CSS is used to layout your page, rather than add the menu on every page. You can use Pyro's code to add your menu from an external file, and then you can use CSS to layout your page. This means your page is more accessible than it would be otherwise.

Any queries just ask

Dave

Charles
07-22-2003, 06:35 AM
1) There is a perfectly fine method of changing two frames at once and it doesn't involve JavaScript.

2) Fames are a perfectly valid part of JavaScript and as such every browser with wich I am familiar have some method of dealing with them, even Lynx. They may simply give the user a menu of the different frames in the frameset, which is why you need to give your frames descriptive names, but the have some method.

redsand198
07-22-2003, 01:43 PM
i want to know why DaveSW above claims that tables "are a bad way to set up your page"

if you look at the source code of half of the most professional websites out there (espn.com, cnn.com, etc) they all use tables to lay out their page.

i was using frames earlier this summer, but then read other reasons not to use them. one is that you use almost twice as many files. even though they are small in size, it's still easy to lose track of where you are linking to.

another reason to not use frames is because search engines look for content when pulling your site up. when your frameset page has no content, you will not get as many views.

but maybe someone can tell us why tables are now "bad"

DaveSW
07-25-2003, 07:24 AM
Because as Charles keeps telling us in other posts certain 'user agents' e.g. browsers or screen readers don't render tables properly. Some will put the first column at the top and just take them out of line. Others will ignore them altogether.
CSS allows you to specify what order the items appear on the page, even if the browser in use doesn't support css.

BTW Charles, what is this method for changing two frames at once that doesn't require javascript? I've never seen anyone use it. Perhaps that's the point...

Charles
07-25-2003, 07:28 AM
I've mentioned it about a dozen times this week. (Questions do seem to come in waves.) You simply swap out the whole frameset, or just a part if you've nested the things.

DaveSW
07-25-2003, 07:34 AM
Charles - I don't often venture into the big bad world of the javascript forum lol.

Just to add to redsand's mention of search engines, if they do index your files and your menu is separate they will link to the content page, without the menu page. Which doesn't help, because users won't be aware that there's anything more to your site.

Also Redsand, those sites probably provide a text only version. css doesn't need a text only, and css will also provide you a printer friendly page using a print style sheet.

So you can save yourself a lot of work by using css. Did I tell you it's quicker to code as well?

ian
08-06-2003, 09:16 AM
OK - acting on some of the advice given here I have experimented with laying out a page using CSS, and attempting to create a navigation bar for it using a file include command which calls up a centrally stored file containing the navigation bar.

My assumption is that the include command should be placed inside a div tag (positioned by the CSS) so that the bar is placed on the page according to the uniform layout specified. However I find that it is seemingly not possible to place an include command inside a div tag - so I still don't understand how I can achieve a properly laid out page which includes a centrally determined navigation bar.

I am using an asp include command.

Am I doing something wrong or am I missing something in how this is supposed to be done?

Ian