by Larisa Thomason,
Senior Web Analyst,
Search Engines Create Orphans
How do visitors even find pages outside your frameset? The culprit is often the NOFRAMES tag. You should always include it to give search engine spiders and visitors with non-supporting browsers a map of your site. But there is a downside.
When spiders crawl through your internal pages, they index each individual page and display them as standalone (or orphan) pages in search results. Think about most framed sites you've seen. They display a navigation bar in a narrow frame on the page's left side and display the content in a larger frame on the right. The navigation frame usually stays constant and visitors use it to view different pages in the content frame.
So when the content pages are displayed outside the frameset, visitors don't see the navigation system. Even internal site links on your content pages may not work because they're designed to load into a frameset. Visitors probably won't realize that the page should be in a frame and just assume that your site is full of broken links.
Send the Page Back To The Frame
In a previous frames article, we showed you how to redirect visitors to your site's home page when they try to load an orphaned page. That solution keeps the navigation structure intact, but may confuse visitors who think they're clicking on an article, but get your home page instead.
Now we're giving you a better solution, courtesy of Ted Ulle, moderator at Webmaster World discussion forums.
This script first checks to see if your content page is trying to display outside its frameset. If so, it redirects your visitor to a framed page and loads the orphan into an alternative frameset that you design. Visitors see the page they expect - in a format that allows them to navigate easily to other pages within the site.
As an added benefit, this is a framed page that visitors can bookmark! Most framed sites aren't bookmark friendly because the site URL stays the same no matter what page you're viewing in the content section. You also lose the benefits of word-of-mouth advertising (or is it word-of-email?) that comes when a visitor wants to share your site with a friend. This script makes both bookmarking and email sharing possible - but only if the visitors enter your site through an orphaned page instead of your home page.
Insert this code into the HEAD section of each page that should always display inside a frameset:
Then, create a new page and name it master.html. Leave the BODY section empty and place this code inside the HEAD section:
Note that this script creates a frameset that allots 20% of the frame size to the left frame and 80% to the right frame. You can adjust these as needed to accommodate your site.
Debugging And Maintenance
- File paths. Check your file paths carefully when you test the pages offline. Netscape browsers are notoriously picky about paths. Then check them again - and edit if necessary - when you upload the pages to a live server.
NetMechanic's HTML Toolbox and Browser Photo tools will help you correct Web site problems and ensure that your orphan pages look great in their new home.