Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Guru 'Geezer' Mechanic
Picture of larryd
Posted
Orphans should have parents. 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 http://www.trans4mind.com/personal_development/JavaScri...esLoadingOrphans.htm 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: 3471 | 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.