NetObjects
Products and Services Partners Support
Scripting with MasterBorders and Autoframes

subheadline
INTRODUCTION

Frames are an HTML feature that let a site visitor view more than one "page" at a time. The visitor can scroll information in one frame while elements in other frames, typically navigation aids, remain in view for easy access. In some cases, a frame can also relieve the visitor's browser from having to reload areas that don't change from page to page.

NetObjects Fusion 2.0 supports two ways to add frames to your site. With the new AutoFrame feature, you can convert any top, bottom. left, or right MasterBorder margin to a frame with a click of your mouse. Or you can use NetObjects Fusion's scripting interface to add HTML tags to create frames yourself. The second method is described in the two usage notes, Adding your Own HTML and Adding Frames to Your Site, and both methods are covered in your NetObjects Fusion 2.0 User Guide.

If you have been creating frames using HTML tags either in NetObjects Fusion's scripting interface or in an HTML editor, you might want to know how an AutoFrame differs from a scripted frame at the HTML level before you choose to use an AutoFrame. This section describes the differences, and tells how to add scripts to MasterBorders and AutoFrames.

Back to Top 

subheadline
AUTOFRAMES VS. SCRIPTED FRAMES

When you create a scripted frame, you first create a page that defines the frameset. Then you create content pages that will appear within the frames. Within the content pages, you can set up targeted links that specify which frame will display the target of links launched from that content page. For example, in the content page for a frame that presents navigation aids, you would use a <base> tag to specify a different (and probably larger) frame as the default for displaying the targets of any links launched from the navigation frame.

With AutoFrames, you use a MasterBorder style to define your frameset as follows:

  1. Choose the MasterBorder style that will define your frameset.
    If you are starting a new blank site and want all pages to share the same frameset, you don't have to do anything. You'll simply modify the Default MasterBorder style. If you want your site to present multiple framesets, you must create a new MasterBorder style for each frameset.
  2. Convert at least one MasterBorder margin to an AutoFrame by clicking the appropriate button on the MasterBorders tab of the Properties palette.
  3. Use margin settings to specify the width of your frames.
    If you have selected the Auto-resize Margins option in the Page tab of the Preferences dialog, you can simply drag margin borders until each AutoFrame is the size you want.
  4. Specify the content for each frame
  5. You can do this more efficiently for an AutoFrame than for a scripted frame because you don't have to create a separate content page. You simply place the elements you want right in the AutoFrame in Page view.

Behind the scenes, NetObjects Fusion sets up the frameset with the AutoFrames you specified, as well as a frame named Body that includes the page's Layout area and any unconverted margins. When you create additional NetObjects Fusion pages and give them the frameset's MasterBorder style, each page in effect is a new content page for the Body frame. The content page NetObjects Fusion creates for each AutoFrame has a fixed name. For example, the Body frame's page is named body_index.html. You can specify a name for your AutoFrame on the Frame tab of the Properties palette, but NetObjects Fusion does not apply your name to the HTML file for the frame's content page.

Back to Top 

subheadline
AUTOFRAMES AND LINKS

When an AutoFrame appears in a browser, launching a link from within the AutoFrame can have one of the following results:

1. If the link references a NetObjects Fusion page that has the same MasterBorder style as the current page, the Body frame displays the content of the target page's Layout area and any unconverted margins. When the following conditions are met, the browser refreshes only the Body frame:

  1. The shared MasterBorder style includes one AutoFrame, and that AutoFrame does not contain highlighted buttons or dynamic content such as a banner whose name changes to reflect the linked page's name.
  2. The shared MasterBorder style includes two parallel AutoFrames (e.g. top and bottom), and those AutoFrames do not contain highlighted buttons or dynamic content such as a banner whose name changes to reflect the linked page's name.

2. In these cases, each frame is still part of one frameset and the center frame (the Body frame) can update without reloading (given that the other conditions for updating are met).

3. If the shared MasterBorder style includes two or more perpendicular AutoFramese.g. left and topthe browser will refresh the entire page. This constitutes multiple framesets which are not nested. NetObjects Fusion 2.0 does not support nested frames. The browser will also refresh an entire page with three or four AutoFrames.

4. If the link references any other kind of pagefor example, a NetObjects Fusion page with a different MasterBorder style or an external HTML pagethe browser exits the frameset and displays the target page in the full browser window.

This means an AutoFrame will never display the target of a link. This might seem limiting if, for example, you want to create a button that displays a different navigation bar within an AutoFrame. If you're accustomed to scripting your own frames, you might expect to be able to create a second content page to be displayed within the navigation frame. In NetObjects Fusion, each AutoFrame in effect can have only one content page, whose elements you can modify in Page view on any NetObjects Fusion page that has that frameset's MasterBorder style. So to achieve the effect you want, you must create a second MasterBorder style with a frameset that is identical to the first except for the navigation bar, then link your button to a page with the second MasterBorder style.

Back to Top 

subheadline
FRAME LINK EXAMPLE

Here's how to add a button to an AutoFrame that will display a specific page in the Body frame.

  • Create a page with an AutoFrame, and in it place a picture for your button.
  • Click the Link... button on the picture's tab on the Properties palette.
  • Select the External Link tab.
  • In the URL edit box, specify the page to link to and the name of the frame that should display it; for example: www.netobjects.com" target="body Instead of www.netobjects.com, you'll type in the path to your target page. If the link is to a page within your site, use a relative path. Do not type quote marks at the beginning and end of text in the URL edit box. NetObjects Fusion will automatically enclose this text with quotes.
  • Press the Link button to close the dialog and create the link.
  • Preview your page and test the link.

To create a link that leaves the frameset and displays the linked page in the full browser window, follow the steps above but type the following in the URL edit box.

Back to Top 

subheadline
USER RESIZABLE AUTOFRAMES

An option described in your User Guide, called User Resizable Frame, lets the site visitor drag an AutoFrame's border to the preferred size. To enable the User Resizable Frame option on the Frame tab of the Properties palette, you must first select the Generate HTML Borders on the MasterBorders tab. This is because if you do not generate borders for your AutoFrame, no boundary line will appear in the browser and your site visitor will see nothing to drag.

Back to Top 

subheadline
AUTOFRAME BOUNDARIES

At the upper-left corner of a page created with NetObjects Fusion defaults, no boundary line exists between the top and left MasterBorder margins. This lets you place elements there that extend into both the top and left margins. If you convert either the top or left margin to an AutoFrame, this benefit is lost. You must place elements within one AutoFrame or the other because elements cannot straddle AutoFrame boundaries.

Back to Top 

subheadline
ADDING SCRIPTS TO MASTERBORDERS AND AUTOFRAMES

NetObjects Fusion 2.0 provides three ways to attach scripts to your pages: Layout scripts, Master scripts, and Frame scripts. The latter two are new in version 2.0 and are described below. Layout scripts are described in your NetObjects Fusion 2.0 User Guide, and in the Adding Your Own HTML usage note.

When you right-click in any MasterBorder, the following pop-up appears.

<Picture: Picture>

The Master Script command brings up the same Script dialog as the Layout Script command. However, the two kinds of scripts differ in where they appear in the HTML files that NetObjects Fusion generates. NetObjects Fusion puts a Layout script in the Body area of just one page, the one that has the Layout to which the script is attached. When you attach a Master script to a MasterBorder, that script appears in the Body area of the HTML file for each page with that MasterBorder style.

When you convert a MasterBorder margin to an AutoFrame, an additional command, called Frame Script, appears in the pop-up menu when you right-click in the AutoFrame:

<Picture: Picture>

When you attach a Frame script, NetObjects Fusion puts it in the content page for that AutoFrame. If you convert an AutoFrame back into a simple MasterBorder margin by clicking the appropriate button on the MasterBorders tab of the Properties palette, any Frame script you have attached to that AutoFrame is lost. You cannot attach scripts to the frameset page NetObjects Fusion creates.

If you prefer, you can add a Master script by clicking the Script button on the MasterBorders tab of the Properties palette, or a Frame script by clicking the Script button on the Frame tab.

Back to Top 

 

 

© 2001 NetObjects, Inc. All rights reserved. Privacy Policy

Company Purchase

 

Search