Forum Moderators: open
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]
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."
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.
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?
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.