Forum Moderators: open

Message Too Old, No Replies

Frame not loading when going directly to the page

The navigation bar set as a frame only loads whenever i go through the inde

         

malone19

3:39 pm on Aug 3, 2008 (gmt 0)

10+ Year Member



I'm trying to update an old site for my mum, very simple html site with the navigation bar set as a frame. I didn't build the site, just update it from time to time...

Anyway, the problem is the navigation bar loads fine when clicking from page to page but if you type in the page you want to go to directly it doesn't load the pane.

The site is http://www.example.co.uk/ but the problem occurs if say you type in: http://www.example.co.uk/page-name.htm

This wouldn't be such an issue if it wasn't for the fact that this page is listed above the homepage in many of google's search results!

Does anyone know a way around this?

Thanks in advance!

Ryan

P.S. I've tried adding the code to add the frame and this works if I go direct but if I go via the home/index I get two nav bars!

[edited by: tedster at 3:45 pm (utc) on Aug. 3, 2008]

[edited by: malone19 at 3:57 pm (utc) on Aug. 3, 2008]

tedster

3:57 pm on Aug 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The Google ranking issue is one of many challenges with websites in framesets - and one of many reason why they are not used so much today.

There is a post in our Javascript forum with an approach to "forcing" the direct url to end up in a frameset. See [webmasterworld.com...] and scroll down to "FORCE MANY PAGES INTO FRAMES with one simple script."

malone19

4:00 pm on Aug 3, 2008 (gmt 0)

10+ Year Member



Thanks, as I said I didn't build the site (nor any site for that matter) but am used to updating my works website and I would have thought something like a php include would have worked better - obviously not possible as it's not php...

malone19

5:25 pm on Aug 3, 2008 (gmt 0)

10+ Year Member



Ok, tried that and it didn't really solve the problem. Do you thin I should just go through and add on the pane/frame to each page which is a pain but the site's not that big so should be achievable?

tedster

8:14 pm on Aug 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you start adding the frameset to the source code for every url, then you'll start getting more than two nav bars - you could get row after row of them as people navigate through the site.

My apologies for being so direct, but I think you don't understand frames well enough at this point to implement such a decision. Your technical description for what you want to do is very imprecise, so I can't say yes or no, but my best guess is to say no.

The javascript solution I pointed you to does what you asked about. It provides the entire frameset, navigation and content, but only in situations where the frameset wasn't already provided in the user's widnow. That eliminates the doubled, tripled navigation frame problem you reported above.

In pseudo-code, the javascript says "somebody just asked for this url, but it's not in the frameset. So I will redirect their request to a frameset page that contains both the nav bar frame and the url they asked for, loaded in the appropriate frame."

That code DOES work, but you do need to implement it exactly as specificied. I've fine tuned it on a number of sites over many years.

However, the better solution might be to abandon frames altogether. For instance, consider placing the navigation in a div that is given a position:fixed rule and use that navigation div on every page. As long as the navigation is not overly large, that woul emulate the frame approach.

Or just relax about people scrolling the navigation off the window and put it in a regular container. Frames are not a good thing in most cases. See Pros and Cons of Frames [webmasterworld.com] for more information - and some good insight into how frames work, as well.

malone19

9:09 pm on Aug 3, 2008 (gmt 0)

10+ Year Member



When I tried the code it made the frame available but it was on the left of the page as a hard frame with a scrollbar, the original frame is positioned at the top of the page as if it is part of the page. Also, I think when I clicked on one of the links it didn't work.

Maybe I implemented it wrong... will have another look.

What I meant by put the frame in every url is to take out the nav bar.htm (not actually called that) altogether and just code it into each page, so I guess that would be removing frames and just having it as part of the page?

malone19

11:47 pm on Aug 3, 2008 (gmt 0)

10+ Year Member



Sorry to bug you, just realised that it's only an issue in firefox...

Edit... nope wrong again, must not have refreshed properly.

tedster

12:22 am on Aug 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



take out the nav bar.htm (not actually called that) altogether and just code it into each page, so I guess that would be removing frames and just having it as part of the page?

Yes, removing frames altogether is the best way forward, IMO. In fact, with the nav bar at the top of the page, the position:fixed approach would work a treat - giving essentially the same appearance to the final pages.