Fun with Frames. The problem I face with my business web site is that it uses frames, and frames are a pain in the neck. Problem is, they do some things you can't do any other way. The primary feature I wanted that called for frames was to have a portion of the screen that could scroll without the rest scrolling. I also got tired of attempting table hacks that required more effort than struggling along with the frames.
Webmasters know that Google and other search sites' crawlers can't read inside of frames. They can read a framed document if you put the contents of the page within a <noframes> pair, but that isn't what actual readers of the site will see, unless you take pains to make it so.
I took those pains, and pains they were indeed. My site has been tremendously hard to modify, and this was what I most wanted to change by moving it into Frontier.
The Problem In order for Google to find what readers will see (and only what you want readers to see), you must do three things:
- Create a data file of the content for each discrete page you want framed.
- Create a frame document for each page of content you want to show. So far, these many frame pages are (or can be) identical except that each reads in a different source file created in step one.
- Copy into each frame file the contents of the content file associated with it, inside a <noframes> </noframes> pair.
Already you can see the problem. You have to maintain two identical pieces of content for every page. Why I did this by hand when I had Frontier sitting idle on my machine I don't quite understand, but until this weekend I did.
The problem is further complicated by the fact that what goes into the <noframes> section is somewhat different from what's reguired for the content file.
What I Did
First, I put the code for the basic frame document into my #template; it's going to be the same for most documents on the site. This template doesn't have a {bodytext} macro in it anywhere. Rather, it has a macro that assembles one of the <frame> tags, the one that will have the variable content, with the URL of the content page in the "src=" bit.
The template also needs to have the HTML for the noframes section. Withing this section is an include, calling for the meat of the content file, without that file's unnecessary opening and closing tags.
(To be continued when I'm awake again...)
12:57:53 AM
|