|
|
Subject:
Website - directing people from an individual frame to the main frameset page
Category: Computers > Internet Asked by: bonnington-ga List Price: $5.00 |
Posted:
27 May 2002 12:07 PDT
Expires: 26 Jun 2002 12:07 PDT Question ID: 18315 |
My site is listed with Google, and I have built it using frames, ie. the main page, www.JamesSchumann.com, is a frameset containing 2 frames within it. I find that sometimes Google lists in its directory one of the individual frames rather than the main frameset, eg. www.JamesSchumann.com/CV/CV.html. When someone clicks on this link, that individual frame gets loaded onto the entire screen rather than the frameset being loaded. Is there any way to make it so that if someone tries to load this individual frames, they get redirected to the main frameset page? Someone told me a way of setting up a 'ghost' version of my website so that people going to an individual frame will be sent back to the main frameset, but this is not really what I am after. I also know that I could take the META tages off the individual frames and then it might not be listed anymore, but I want to still be able to put META tages on all the frames. I am looking for perhaps some HTML code that will direct people from an individual frame to the to the main frameset, but still allow the individual frames to be loaded properly within the frameset page. I would need to know exactly what code to use and where to put it. |
|
Subject:
Re: Website - directing people from an individual frame to the main frameset page
Answered By: j_philipp-ga on 27 May 2002 14:42 PDT Rated: |
Hello, To check if a page is called without the frameset, and to redirect to the homepage, you can put the following JavaScript in the HTML page: ---------------- ... <head> ... <script type="text/javascript"><!-- function checkFrameset() { if (top == self) { top.location.href = "http://www.JamesSchumann.com"; } } // --></script> </head> <body onload="checkFrameset()"> ... ---------------- However, you should know that this has side-effects: - it only works if JavaScript is enabled - it will confuse the browser history (like when you click "Back") - it will take the page a bit longer to load - it will not immediately show the content the search engine indexed A very good alternative to all this is to include whatever part of the site is constant (e.g. the navigation) on the server using server-side scripting. In that case, there's still only a single file containing the static part, but before the content is served to the client it gets merged with it. I can clarify this solution if needed, but for that it's important to know which scripting your server supports (like PHP, Python, ASP). Another option is to include the static navigation in all HTML files. You can update it using local search-and-replace. On a sidenote, if you keep with the frames solution: it will help some visitors and search engines if you put a <noframes>...</noframes> section in the framesetting page. Also see W3C on "noframes": http://www.w3.org/TR/REC-html40/present/frames.html#h-16.4.1 I hope this helps! | |
| |
|
bonnington-ga
rated this answer:
Thank you, detailed answers - but making me realise I am a bit out of my depth! |
|
Subject:
Re: Website - directing people from an individual frame to the main frameset pag
From: zzen-ga on 27 May 2002 15:14 PDT |
There is another workaround, but it should be noted I do not really recommend it. I supply it only to give you the choice: If the frames are a integral feature of the page and cannot be easily eliminated via server-side inclusion of common navigation and such (as described above), you can keep your frames and still make Google point users correctly to the whole framesets: for EACH page of your site, you need to make a frameset document, which has the common part (navigation etc.) as one of its frames and the frame with the corresponding content as the other frame. For example, if you have a current site which looks like this: index.html (the frameset page) navigation.html (the "common frame") foo.html bar.html contacts.html (these three are pages displayed in the content frame) Then you might rework your site as follows: index.html navigation.html f_foo.html foo.html f_bar.html bar.html f_contacts.html contacts.html Where each f_*.html file is a frameset document with the first frame navigation.html and second frame corresponding *.html file. Then, all your LINKS inside your site should be replaced as follows: <A HREF="foo.html"> becomes <A HREF="f_foo.html" TARGET="_top">. The positive effects: each content page has now its own unique frameset page and you link only to the frameset pages. Thus, Google bot will also collect only links to FRAMESET pages and clients will be pointed to the correct content page and still have all the framesets displayed. A second alternative (modification of the above answer about JavaScript redirects) is to programm a server-side script (PHP, Perl), which supplies the frameset document and dynamicly substitutes the address of the second frame for the address from which the client was redirected to this page (that's called the REFERRER and is available in the HTTP header file sent with each request). The script would then check: *) if the REFERRER comes from your site or from elsewhere and do one of the two actions based on the result a) if the REFERRER comes from elsewhere, the send out the plain frameset document with "default" content frame (as in index.html or simillar) b) if the REFERRER comes from your site, substitute the address of the content frame in the frameset document for the address of the referrer. This has basically no sideeffects (not counting those which were mentioned in the previous answer) and enables the client to transparently recieve the requested content page with the frame supplied around it. Also - no changes to links in the site are required - only add the PHP script and point all javascript redirects mentioned in the previous answer to this script. If more info is needed, I will happily supply. |
Subject:
Re: Website - directing people from an individual frame to the main frameset page
From: budsmith-ga on 27 May 2002 23:23 PDT |
A quick solution is to add a Home link on all your content frames. That way the user who finds your frame in Google search can quickly get to your home page, then use navigation or site search (if you have it) to get back to the content they want - with the whole frameset, this time. More complicated is to use the solution you got in the answer, but also to have a separate frameset and slightly different JavaScript for each content page. That way you can call the right frameset, instead of the home page, from each target frame that gets pulled up by itself. |
Subject:
Re: Website - directing people from an individual frame to the main frameset page
From: budsmith-ga on 27 May 2002 23:25 PDT |
For details on how to implement the solution I mentioned, check out this Jakob Nielsen article: http://useit.mondosearch.com/cgi-bin/MsmGo.exe?grab_id=3417176&EXTRA_ARG=&host_id=2&page_id=122&query=frames&hiword=FRAMES+FRAME+FRAMESET+FRAMED+FRAMEBASED+FRAMELESS+ |
Subject:
Re: Website - directing people from an individual frame to the main frameset pag
From: mach-ga on 28 May 2002 15:05 PDT |
The problem with all the above solutions is that none of them actually direct the user to the page that they are viewing with the navigational bar (the other frame). Embedding this little script will bring the user to a page with the correct frames. This page tells how to implement a _full_ solution: < http://www.webreference.com/js/column36/forcing.html >If you need help just post something on this thread and I'll help you with it. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |