Leading Orphan Pages Back Home
Many thanks to fellow Virtual Mechanic TonyC for his time and effort in testing these procedures.

Orphans should have a good home. And your orphan pages are no exception.

When a search engine scans your site and indexes the pages, it does not know if you intend any of the pages to be used 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.

For example, if you click on this link, this page will open in a new window. The URL displayed in the address bar is typical of what search engine would store when it scanned your site. However, if you click this link, then the page will reload in its home frame.

If your page was designed for a frame, it most likely does not provide a navigation menu; after all, that is the purpose of the page containing the frame. Visitors 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 orphan pages a home. What follows is a very simple javascript solution found here. This link discusses a solution for pages using framesets, but the same solution can be applied when using SiteSpinner i-frames. The following steps describe how to add javascript code to SiteSpinner pages containing iframes and the pages being inserted into the iframe. Instructions are also given further down the page on how to correct framesets just in case you have decided to use them in SiteSpinner.

1. On the page containing the i-frame, insert the following code in 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 geometry name of the
    // i-frame where you want to load the orphan page.
    lowerPage.location = mypage;
  }
}
</script>
<body onload='setPage();' >

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

2. On the SiteSpinner 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 the page
  // containing the i-frame.
  var framePage = 'orphanFrame.html';
  if (top.location == self.location) {
    window.location = framePage +'?'+ window.location.pathname;
  }
}
</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 object. This must be done to make sure that the orphan page is loaded into the correct frame on the correct page.

When all changes have been made, publish you project. Your orphaned pages can now find their homes.

Fixes For Framesets

If you use framesets within SiteSpinner, the above steps will work but need slight modifications. Before beginning, you must ensure that your frames within the frameset use the name attribute. This is important since the javascript code uses the frame name to identify the required target frame.

1. Insert the following javascript code inside a custom header holding your frameset code (this is usually your index page). This script code must be placed before the HTML 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;
  }
}
</script>

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

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

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

(Note that the "..." represent other frameset HTML code options.)

2. On the page to be loaded in the frame, add a custom header and insert the following javascript code:

<script type='text/javascript'>
function loadinFrame() {

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

Be sure to change the "orphanFrame.html" to the HTML page name containing your frameset (normally index.html). When done, publish your project.