Forum Moderators: open

Message Too Old, No Replies

frames question

         

hartzoua

8:13 am on Mar 1, 2006 (gmt 0)

10+ Year Member



Hi,
I've created a site which uses three frames, two stable and one with the main content. The problem is that when the user searches through Google for example, the results lead to the third frame, so the two others having the menu and the logo never show up! I know , I know what you will say, "Redesign and get rid off the frames, they are evil!". I don't like them either but my client does, so it would be useful if I could find a solution.
So I search for a way to identify every time a page loads if the two other frames are present and if not to refer to the appropriate URL so that all the frames are been shown. Any ideas about the identification?
Thanks in advance

percentages

8:22 am on Mar 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Frames are a bad idea these days!

But, if you have to do them then here is a JS answer to the problem:

<script language="JavaScript">
if(self.parent.frames.length==0)
self.parent.location="index.html";
</script>

Put this code into every page and it will detect if the "frame" pages are not yet loaded and load them. "index.html" should be changed to be the base frame page.

It is not a good solution, and isn't liked by Yahoo these days.....but, it is a quick fix if you insist on using frames.

hartzoua

8:35 am on Mar 1, 2006 (gmt 0)

10+ Year Member



Thanks,
It seems to be what I want. I will try it And i' ll let you know.
P.S.: I personaly kind of hate frames but some people can't stick out of what they have in their minds. So I have to continue using them :(

encyclo

11:11 am on Mar 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to try the code in the following thread:

  • Force many pages into frames [webmasterworld.com] (msg#21 by tedster)

    However, if at all possible it is better to remove the frames entirely and use server-side includes (SSI, PHP...) instead for the menu and header sections. Keep trying to convince your client, you might win one day! :)

  • hartzoua

    8:56 am on Mar 2, 2006 (gmt 0)

    10+ Year Member



    Thanks a lot.
    This is exactly what I want!

    kaled

    11:58 am on Mar 2, 2006 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    if (top==self) location.replace('frameset.html');

    This is simpler and won't break the back button.

    The intrinsic problem with frames is that they have been implemented badly by the designers of HTML.

    You might consider using { position:fixed } possibly with IFrames (if this content need not be indexed). This will work fine in Opera and Firefox and maybe IE 7.

    Kaled.

    tangor

    12:10 pm on Mar 9, 2006 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    Is it possible to use Perl to force an orphaned page into the frameset by adding a one line call to the top of each page?

    If so, how would that be implemented?

    While I do understand that SSI and CSS offer many new advantages, I was hoping to put off a site overhaul until later!

    Thanks!