Building the Search Results page

The Search Results page displays the records that are found or matched according to the search request made in the Search page. There are two ways of displaying records in a found set: as a list or as a table.

Formatting results

The FMP-Record tag appears as an area that contains the fields for the records in the search results page. In the browser, this record area will repeat depending on the number of records found and the maximum number of records displayed per page. For information on setting the maximum number of records displayed per page, see Setting options for the search results.

To format search results as a list:

  1. Create a new blank page.
  2. Choose FileMaker Form Library from the View menu (Windows) or the Window menu (Macintosh).
  3. In the SEARCH section of the library, select the entry for Displaying results under the Search Results Page section.
  4. Drag the FMP-Record tag into your Search Results page.

  5. Position the pointer so that it is within the FMP-Record area, and then copy and paste a FMP-Field tag for every field you want to appear in the area.
  6. Double-click each FMP-Field tag to display its object editor, and then type the name of the field for each tag.
  7. Close the FMP-Field Tag Object Editor to apply your settings.
  8. Add text to the area to create field labels, if necessary.

Tip In the browser, the elements within the FMP-Record tag area (denoted by the box with the red border) repeat as many times as there are records in a found set. You can format the orientation of the elements in this tag, so that multiple records appear vertically in the browser by typing a carriage return character. Press Enter (or Shift-Enter for less white space between lines) on Windows; or press Return (or Shift- Return for less white space between lines) on Macintosh, immediately following the last FMP-Field tag in the FMP-Record area.

To format search results as a table:

  1. Create a new blank page.
  2. Open the FileMaker Form Library.
  3. In the SEARCH section of the library, select the entry for Displaying results under the Search Results Page section.
  4. Drag the table element from the library into the Search Results page.

    The table displays two columns, each with a field and field label. The row in which the FMP-Field tags appear is identified by a red border.

  5. Type over the Field_Label text to replace it with the name of the field.
  6. To add more columns (to display fields), double-click the table border to display the Table Object Editor.
  7. Click the Table tab, and type a number in the Columns text box, or click Add Column.
  8. Copy and paste the FMP-Field tag so it appears in each additional column and within the red border.
  9. Double-click each FMP-Field tag to display its object editor, and then type the name of the field for each tag.
  10. Close the FMP-Field tag object editor to apply your settings.

You can set up any table you create with Claris Home Page to display results for your search. To do this:

  1. Double-click the table border to display the Table Object Editor.
  2. Click the FileMaker tab, and then select the Use as FileMaker results table check box.
  3. Type a number for the row where the FileMaker record information will end in the table in the End Repeating at row text box.

    The default is 1, but if you are using the first row to display field labels (field names), type the number 2.
  4. Type a number for the row where the FileMaker record information will begin in the table in the Start Repeating at row text box.

    The default is 1, but if you are using the first row to display field labels (field names), type the number 2.
  5. Close the Table Object Editor to apply your settings.

For search results formatted as lists or tables, the maximum number of records displayed per page will vary based on options you set in the Search page. See Setting options for the search results for more information.

Building navigational links and text

Your Search Results page can contain tags for navigating to the next and previous pages of records in a found set as well as links to the Record Detail page, which shows one record per page. You can also include tags that provide information about the FileMaker Pro found set.

To add navigational links to the previous and next range of records in a found set:

  1. Open the FileMaker Form Library.
  2. In the SEARCH section of the library, select the entry for Navigating under the Search Results Page section.
  3. Drag the FMP-LinkPrevious and FMP-LinkNext tags into your Search Results page.
  4. Place the insertion point so that it is within the FMP-LinkNext and FMP-Previous areas, and then type the text for the links.

To make the field data that is returned in the Search Results page into a link to the Record Details page for the record displayed:

  1. Open the FileMaker Form Library.
  2. In the SEARCH section of the library, select the entry for Navigating under the Search Results Page section.
  3. Drag the special FMP-Field tag in the Link to Record Detail section of the Displaying results library entry into the FMP-Record area.

    The special FMP-Field tag is denoted by a blue border in Edit Page mode to indicate that it is a link.

    If you are using a table to format the search results, drag the special FMP-Field tag into the appropriate table cell (any cell in a row or rows denoted by the red border).
  4. Double-click the special FMP-Field tag to display its object editor, and then, in the Field Name text box, type the name of the field that will be the link to the Record Detail page.
  5. Close the special FMP-Field Object Editor to apply your setting.
  6. With the FMP-Field tag selected, choose Link Editor from the View menu (Windows) or choose Show Link Editor from the Window menu (Macintosh).
  7. In the Link Editor, type the name of your record detail page in place of "record_detail.htm." In place of "layout name here," type the name of the layout used by the page you are linking to.
  8. Close the Link Editor to apply your setting.

Including search information and statistics

You can include search information and database statistics in the Search Results page. Including search information is useful when testing the pages or to provide information to your Web audience. Tags for indicating the current action (find), current database, current layout, current format, and current maximum records per page are examples of information you can provide.

To add search information and statistics to the Search Results page:

  1. Open the FileMaker Form Library.
  2. In the SEARCH section of the library, select the entry for Search information or Statistics under the Search Results Page section.
  3. Drag the tags you want to include in the Search Results page (for example, drag FMP-CurrentMax).
  4. Type the text you want next to the FMP-CurrentMax icon.

Saving the Search Results page

When you save the Search Results page, the name should correspond to the filename used in all files that refer to it. In the case of the Search Results page, its filename is specified in the -Format tag of the Search page. For example, the Search page named "search.htm" might refer to the Search Results page called "search_results.htm." See Building the Search page for more information.


Previous topic | Contents | Next topic