Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Guru 'Geezer' Mechanic
Picture of larryd
Posted
Orphans should have homes. And your page orphans are no exception.

When a search engine scans your site and indexes your pages, it does not know if any of your pages belong in frames. It just sees the page as a page. If you have pages that are designed to appear inside a frame, then the search engine has just created an orphan. Anyone who now uses that search engine has access to your framed page, but when they click on the search engine Link, the page will appear in a normal browser window and not your frame.

Because you page was designed for a frame, it most likely does not provide a navigation menu; after all, that was the purpose of the page containing the frame. They also may not be aware of your site URL since they only see a page link in the address bar (this depends on the search engine and how it redirects the link).

While this may seem to be a drawback to using frames, there are ways to correct this and give your orphans a home. What follows is a very simple javascript solution found here. That link discusses a solution for pages using framesets, but the same solution can be applied when using SiteSpinner i-frames.

1. Identify the page holding the i-frame and add the following to a custom header:
<script type="text/javascript">
function setPage() {
if (location.search)
{
var mypage = location.search.substring(1,location.search.length);

// change only the name, "lowerPage", below to the name of the frame
// where you want to load the orphan page

lowerPage.location=mypage;
}
}//end of setPage()
</script>
<body onload="setPage();" />


As noted in the code, make sure you change the "lowerPage" name to the actual name listed in the geometry name field of the i-frame. If this is not done, the orphan page will not know where to go.

2. On the page to be displayed in an i-frame, insert the following in a custom header:
<script type="text/javascript">
function loadInFrame() {

// change the page, "orphanFrame.html" to the name of your
// frameset page
var framePage = 'orphanFrame.html'
if (top.location == self.location)
{
window.location = framePage +'?'+ window.location.pathname
}
} // end of loadInFrame()
</script>
<body onload="loadInFrame();" />


As noted in the code, you must change the "orphanFrame.html" value to the actual name of the HTML page containing the i-frame. This must be done to make sure that the orphan page is loaded into the correct frame on the correct page.

When all changes hav been make publish you project(s). Your orphaned pages can now find their parents.


If you use framesets within SiteSpinner, the above steps will work but need slight modifications.

1. If your frames are not defined using names, modify the frame tag to include the name attribute. This is important since the javascript code must find the required frame by name.

2. Insert the following inside the custom header holding your frameset code. It must be placed before the frameset code.
<script type="text/javascript">
function setPage() {
if (location.search)
{
var mypage = location.search.substring(1,location.search.length);

// change only the name, "lowerPage", below to the name of the frame
// where you want to load the orphan page

lowerPage.location=mypage;
}
}//end of setPage()
</script>


Be sure to change the "lowerPage" name to the actual name of your frame used to hold the orphan page.

3. In the frameset tag, add the onload event so the above script executes when the page loads: e.g.,

<frameset rows="...  onload="setPage();" ...>


4. In a custom header in the page to be framed, insert the following code:
<script type="text/javascript">
function loadInFrame() {

// change the page, "orphanFrame.html" to the name of your
// frameset page
var framePage = 'orphanFrame.html'
if (top.location == self.location)
{
window.location = framePage +'?'+ window.location.pathname
}
} // end of loadInFrame()
</script>
<body onload="loadInFrame();" />


Be sure to change the "orphanFrame.html" to the HTML page name defining your frameset. When done, publish your project(s).
 
Posts: 3469 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Power' Mechanic
Picture of Bruceee
Posted Hide Post
Thanks Larry -- another great tip that I have only just noticed Smile

If you use frames without a trick like this, you should consider how your pages will navigate without the frame. One way might be to use a <NOFRAMES> tag to provide some very basic navigation, like to your home page or site map.

If the page is viewed outside the frame (as discovered by a search engine), you then display the basic navigation on the page. If the page is in the frame, the basic navigation could be omitted. Would <NOFRAMES> do that?
 
Posts: 7892 | Location: Wellington, New Zealand | Registered: December 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
Since the <NOFRAMES> tag is supposed to tell the browser what to do if it doesn't handle frames, I would assume trying to force an orphan page to load in a frame would result in the standard message "Sorry, your browser is unable to handle frames." (if included between the tags) or no action at all.

Now I have to find a browser that doesn't support frames to test what will happen. Just what I need, another browser.
 
Posts: 3469 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.