|
findinsite-cd - ensuring that the correct frameset is shown
Introduction
If you use framesets, then you may have problems when FindinSite-CD tries to display a page.
FindinSite-CD simply tries to show the relevant page - not the frameset containing the page.
If you use FindinSite-CD in a frameset then it will probably display the page correctly.
See frames solution 1
and frames solution 2.
If this is a problem, then read on... A different solution is recommended
depending on whether you use word highlighting or not.
No word highlighting
If you are not using word highlighting, then there are two possible solutions:
- The first possible solution is to tell FindinSite-CD to display the frameset instead of the page.
You can do this using a custom tag (META phd-spy-rebase)
at the top of each tag to change the page name and target. For example, if a page should
be displayed in a frameset called
frame.htm, then put this in the page header,
and rescan with FindinSite-CD-Wizard or Findex:
<META name="phd-spy-rebase" content=",frame.htm,">
- The alternative is to put this block of JavaScript in the page header.
If the page is not being shown in a frameset, then it tells the browser
to display the frameset instead.
<SCRIPT LANGUAGE="JavaScript">
<!--
if (window.parent==window)
location.href = 'frame.htm';
//-->
</SCRIPT>
With word highlighting
If you want to use word highlighting, the above techniques cause problems.
Here is one solution and one fallback option:
- This solution uses JavaScript in the page header again to detect if the page is being shown in a frameset.
If it is not, it does not tell the browser to display the frameset straight away.
Instead, it waits for 2 seconds before doing it,
ie when the word highlighting has hopefully been completed.
The required JavaScript functionality (setInterval) is not present in Netscape Navigator 3 (N3).
Therefore the script is not run at all in N3 (because the script language is JavaScript1.2).
Use the following simpler solution for N3 browsers.
<SCRIPT LANGUAGE="JavaScript1.2"> <!-- setInterval not in N3 -->
<!--
function ensureinframe()
{
location.href = 'frame.htm';
self.clearInterval(tid);
}
if (window.parent==window)
var tid = self.setInterval('ensureinframe()',2000);
//-->
</SCRIPT>
- A simpler solution is to display a message to the user if the page is not in a frameset.
The message should include a link to the correct frameset.
Ensure that this code is in the page body, just after the BODY tag.
<SCRIPT LANGUAGE=JavaScript>
<!--
if (window.parent==window)
document.writeln('<H3>This page is designed to be shown in a frameset. <A HREF="frame.htm">Click here to show frameset</A></H3>');
//-->
</SCRIPT>
|