the complete webmaster
tutorials reviews reference
ASP
CGI
FrontPage
HTML
Java
JavaScript

home / articles / frontpage

Using Frames With FrontPage 97

Do Frames confuse you? FrontPage 97 provides a pretty straightforward Wizard for creating them, but many people get frustrated by what it leaves out. If you've ever created a Frameset in Frontage and then found your hyperlinks from say, the "Contents" frame end up appearing in that same frame, all scrunched up and replacing your nice Contents page, then you know what I mean. Or how about when you view the Frameset in Netscape and find that the top is not quite at the top? And the worst fear of all; not being able to make your Frameset the default page for your website!

This week's article is meant to fill you in on those little things that drive you nuts and how to avoid them. First, some basic terminology:

  • Frameset: A container, if you will, in which you define rectangular areas called "Frames", in which multiple documents are displayed at the same time. A Frameset is not a real document that you view. It just defines the layout for the "Frames" in which other pages are displayed. Framesets can also contain other framesets, but let's start off slowly.
  • Frame: A Frame is a rectangular area within a Frameset. Documents are displayed in Frames. Frames have a number of attributes that you can define, such as whether the document within the frame can be scrolled.
  • Target Frame: Documents within frames need to have a "Target Frame"; a frame within the frameset which will display its hyperlinks. Without a Target Frame, clicking a hyperlink will result in the linked document being displayed in the same frame that the hyperlink was clicked from. This is usually desireable for "Main" pages (the large ones holding most of your content), but rarely for say, a Contents frame. Individual hyperlinks within a page can have their own target frames, separate from the pages "default" target frame.

Now, let's make a simple frameset with FrontPage 97. But, before we get started, create four very basic html pages (unless you already have pages you intend to work with). Name them "banner.htm", "main.htm" "contents.htm" and "noframes.htm". This last file will be the one displayed to those poor folks whose browser doesn't recognize frames (yes, they still exist). Each need only have one line of text in it, such as "I'm the banner page" or something else like that...you get the picture. Now we're ready to go.

Start by opening FrontPage and selecting Tools | Show Editor to bring up the FrontPage Editor. Now select File | New and choose Frames Wizard from the list of file types. On the first screen you can select from some templates to get an idea of what various framesets look like, but ultimately choose Custom. You'll get a screen like this:

This is a good basic layout to work with. It has three frames; one at the top for a Banner or Navigation section, one at the left for a Contents section and one toward the right for the Main pages you want to display. I find, however, that the left frame is a bit too wide, so let's shrink it a bit. Place your mouse pointer on the vertical separator line and when it turns to a double-headed arrow, press and hold the left button and drag the line to the left just a bit to make that frame a bit thinner (and the adjacent Main frame a bit wider). Click on "Next".

Now we'll define some basic attributes of the individual frames using this screen:

We will define attributes for all three frames on this screen BEFORE we press the Next button.
First, select the Top frame by single-clicking it so that it is highlighted like in the picture.

In the Name box, type "frTop" (It's good to name frames beginning with "fr" and ending with a logical and easy to remember name.). Set the Source URL to "banner.htm", the file we created a minute ago. Set Margin Width and Margin Height to "0" for now. Also, set Scrolling to "no" because we don't want our banner fram to be scrollable in this example.

Now click on the Left and Right frames and set them as follows:

  Left Right
Name frContents frMain
Source URL contents.htm main.htm
Margin Width 0 0
Margin Height 0 0
Scrolling Auto Auto

When done with all three frames, click on Next and Browse for the "noframes.htm" document you created earlier. This becomes the Alternative URL for browsers wjhich don't support frames.

Click Next again and save the file with its default Title ( Frameset1) and URL (frames1.htm). Congratulations! You've made the basic Frameset. Now, how do you see it? Well, go to your browser and type the path to your web and the document name frames1.htm. You should see something like this:

 

Now for those "little things". For this part, you'll need to open "frames1.htm" with a text editor (Notepad will do just fine).

No Borders: If you don't like those lines between each frame, open the file in Notepad and look for the <Frameset> tag. It' probably says something like <frameset rows="15%,85%">. Edit the line so that it looks like this:

<frameset rows="15%,85%" frameborder="0" border="NO" framespacing="0">

Save the file (make sure you then click on FrontPage Explorer and wait until the updated file is imported into the web site). Now, go back and display your frameset again. The borders will be gone.

TopMargin: Netscape likes to add about 10 pixels to the top and right borders of your frames. This looks pretty bad in a Banner frame where you end up with a "dangling" Navigation bar. To avoid this, open the frames1.htm in Notepad again and go to each of the three <Frame> lines.

Add the attribute topmargin="0" to ach one, so that they look something like this:

<frame src="banner.htm" name="frTop" marginwidth="0" marginheight="0" topmargin="0" scrolling="no" noresize>
(Note: Do not change the "scrolling" attribute from what is already set.)

The bad news here is thatI still haven't found a way to get rid of the 10 pixels that Netscape adds to the right! If you find out, please email me.

Default Page: Here's an easy one that sometimes gets overlooked. To use the frameset as your default page, just rename it "default.htm" or "index.html" or whatever your web uses for its default document name (Don't laugh. A lot of people ask this question).

Links: By far the most frequent problem I've heard from people is that of making Hyperlinks work correctly. It's really pretty easy, but there are a couple of "gotcha's" tp watch out for.

First, define a default target for each document in your frameset. You do this by opening each one in the FrontPage Editor, right-clicking on the document and setting the "Default Target Frame". For "banner.htm" and "contents.htm", set the Default Target Frame to "frMain". This will make all their hyperlinked documents appear in the "Main" frame (this setting is case-sensitive, so be careful).

Note that if you don;t specify a "Default Target Frame", hyperlinks will display in the same frame from where they were clicked (this is usually good for the "Main" frame's document.

Here are some tips on Target Frames:

  • Individual Hyperlinks can have their own Target Frames: Just use the "create or edit hyperlink" button and specify the link's target frame there. This will override the pages Default Target setting.

  • Special Targets: Generally, Target frames must begin with an alpha-numeric character, with a few exceptions:

    1. TARGET="_self" causes the linked document to load in the same frame from where the link was clicked.

    2. TARGET="_top" causes the linked document to replace the Frameset and occupy the entire window.

    3. TARGET="_parent" causes the linked document to display in the frame's immediate Frameset parent (play with this one).

    4. TARGET="someothername" will open the linked document in a new browser window.

If you've read this far you deserve to learn about another cool thing you can do with a Frameset. Since the text doesn't display, it's a great place to put text that some search engines will use to index your site! If your site has to do with "widgets" you can open the frameset in a text editor and add lots of content relative to widgets. The content won't display, but it will be indexed by certain search engines and can elevate your rankings.

Have Fun!

Author: Frank J. Mazzella
Date: 10/13/97

More articles about FrontPage
More articles by Frank J. Mazzella
Author Biography

write for us about us advertise

Copyright 1997, 1998 A Big Lime. All rights reserved.

ttom2.htm" -->