Creating websites with frames and search engine
optimizing
This tutorial shows
you how to make frames and open subframes within the frame.
You will learn how to preserve the function of back button
and prohabit opening your frameset page within another (foreign) frame.
The searchengine indexing problem will overpas by giving some content
within the Nonframe-Tag.
This tutorial intend to give you a quick fix, how to make a
professional website with frames. |
|
|
top.htm |
|
left.htm |
main.htm |
|
Frames Websites are friendlyer for navigation
and reloads only the part of the site.
Frames cappable browser are Netscape 2 (or later), Internet Explorer 3
(or later)
We will show an example of frames with index.htm as a framset
page
left.htm, top.htm, main.htm as subpages.The simple code for the frameset
page:
<frameset rows="100,*">
<frame src="top.htm" name="top">
<frameset cols="150,*">
<frame src="left.htm" name="left">
<frame src="main.htm" name="main">
</frameset>
</frameset>
|
|
Demo
click to open frameset page |
On our frameset page (index.htm) you need to add the
scrolling="no"
if your subframe (as left and top) should not scroll. You may
want to hide the frame border with
frameborder="0" We have still some problems with this
code please localize it by clicking the demo.
What happend if you click on the subpages or give the name direct to the
browser?
The problem is
one can open the subframes alone, out of the frameset
|
|
Demo
click to open frameset page |
With the Javascript we can automaticly load the whole frameset page on click to
one of the subpages.
You should eventually change the file names for the subpage:
var ar0 = "top.htm";
var ar1 = "left.htm";
var ar2 = "main.htm";You can download all the final pages
later. |
|
Demo
click to open main subpage |
For each subpage you need to suite the code
if
(top.location.href.indexOf("index.htm") == -1)
top.location.replace("index.htm?main.htm&2");
Note the part
"index.htm?main.htm&2" for main subpage
"index.htm?top.htm&0" for top subpage
"index.htm?left.htm&1" for left subpage
Did you see so many frameset pages block the back Button of the browser!?
The solution is
top.location.replace
We have still one problem , please localize it by clicking the index in the
left subframe
Did you see one could open our frameset page within the other frameset page! |
|
Demo
see the final solution |
We can solve the problem by putting the code:
if
(top.location != self.location) {top.location = self.location}
The problem that we still have is that serarchengines index each subframe rather then
the
frameset page, since the frameset page has no content informations.
Let us give some informations on the NONFRAMES TAG:
'<NOFRAMES><body>',
'In our shop you can buy ... ',
'</BODY></NORFAMES></FRAMESET>'
You will need to give some other informations in META TAGS to complete
your site and add to searchengines.
|