IRT Logo

Orphan-proofing School of Medicine sub-pages

Do you maintain a School of Medicine web site using the frames-based system we've developed (SiteBuilder)? Frames-based sites are great, but they do have a couple of drawbacks. One is the difficulty of pointing people to your subpages without orphaning the pages outside of the frames system. To fix that, we developed FrameMaster.

A very closely related problem is having your sub-pages get orphaned by our Search Engine (or anyone's search engine, for that matter). Search engines index the full content of all of your pages–and if someone finds one of your sub-pages through a search, and goes to it, they will get the sub-page orphaned outside of your frames system. This is unattractive, confusing, and in other ways less than ideal. Luckily, we've concocted a pretty easy fix using JavaScript in conjunction with FrameMaster. Simply embed the following snippet of code within the <head> section of all of your School of Medicine sub-pages:

<script language="JavaScript">
<!-- begin javascript
if (window.self == window.top) {
	var path = location.pathname;
	window.location = "http://med.stanford.edu/fm/?" +
	path.substring(0, path.lastIndexOf("/") + 1) + "&" +
	(path.substring(path.lastIndexOf("/") + 1, path.length))
	+ "&" + location.hostname;
}
// end javascript -->
</script>

Any page with this code that you go directly to will figure out that it is orphaned, and redirect itself (using FrameMaster) to inside of its parent frameset. Et voila–the page is effectively orphan-proofed.

A couple of caveats: This only works for sites which conform to the frames-based design templates we have developed. It only works for JavaScript-enabled browsers. And you must have a localnav.html file in the same directory as the sub-page in question. Have

Netscape/Windows NT printing bug

Apparently the JavaScript code that orphan-proofs framed pages interferes with printing on PCs with Netscape and Windows NT. When you click on the frame to select it, and try to Print Preview or Print, the page is blank, and you may get an alert saying "Nothing to Print." There are two suggested work-arounds:

  1. Turn off JavaScript while you print. Get the Preferences command, select "Advanced" and click off the checkbox next to "Enable JavaScript." You should now be able to print normally. Don't forget to turn JavaScript back on!
  2. Switch to another browser, such as Microsoft Internet Explorer, which does not have this problem.