Developer’s Guide

Table Of Contents
6-12 Developer’s Guide
2. In the Script Definition dialog box, click Clear All, and select Toggle
Status Area. Choose Hide from the Specify pop-up menu to add the
parameter to the script step. Then click OK.
3. Click Done to close the Define Scripts dialog box.
4. Choose Edit > Preferences > Document.
5. In the Document Preferences dialog box, select the checkbox for
Perform script when opening the database, and choose the script you
named in step 1 from the pop-up menu.
6. Click OK.
For more information, see “Defining scripts” in chapter 10 and
“Setting document preferences” in appendix A of the FileMaker Pro
User’s Guide or see FileMaker Pro Help.
Bypassing the Instant Web Publishing home page
You can bypass the built-in Instant Web Publishing home page so
that the database layout you’ve created appears as the default home
page in the web browser. You do this by writing a redirect statement
in an HTML file that includes a FileMaker CGI request and then
designating the file as the default home page in FileMaker Pro.
For the FileMaker CGI request, you’ll need to know the URL of the
view (instant web page) that you want the database layout to appear
in. You can get this from the browser window by displaying the
database in the Instant Web Publishing home page and moving the
cursor over the link or clicking the link to go to the view.
To bypass the Instant Web Publishing home page:
1. Create an HTML file that contains a redirect statement to your
database layout.
2. Save the HTML file with the .htm or .html extension and place it
in the Web folder.
3. In the Web Companion Configuration dialog box, specify the
HTML file to be the default home page. (See “Setting Web
Companion configuration options” on page 6-3.)
For example, the following redirect statement contains a FileMaker
CGI request for layout ID number 3 in the “MyCustomUI.fp5”
database to open in the Form View instant web page
(formvwcss.htm).
<HTML>
<BODY>
<SCRIPT Language="JavaScript">
window.location ="/FMRes/FMPJS?-db=MyCustomUI.fp5&
-layID=3&-token=25&-max=1&-format=formvwcss.htm&
-mode=browse&-findall"
</SCRIPT>
</BODY>
Note In the Internet Explorer 4.5 for Mac OS browser window, you
must allocate at least 6 MB of memory to the web browser in order
to display the database layout.
Here’s another example of a redirect statement that displays the
database layout in the browser window.
<!DOCTYPE HTML PUBLIC “–//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/1999/REC-html1401-19991224/loose.dtd”>
<HTML>
<HEAD>
<META HTTP-EQUIV=”Refresh” Content=”0; URL=/FMRes/FMPJS?
–db=MyCustomUI.fp5&–layID=3&-token=25&-max=1&
-format=formvwcss.htm&-mode=browse&-findall”>
</HEAD>
<BODY>
</BODY>
</HTML>
Note Layout ID numbers are determined by the original creation
order of all the layouts created for the database.