Creating details pages
A sample page that displays the details of a single record in an online database. A search or query page generally lets the viewer click an item or hit in a search result list in order to focus on just that entry. The clicked item leads to another page commonly called a details page that shows information on just the one item--a product in an online store, a single press release, or an entry on one DVD in a collection of thousands. This section assumes you already have a site created, open, and configured as a dynamic content site. Open a blank page in the site, make it dynamic, add a content source to the page, and then proceed as follows. For this example, you'll do the following: - Use a table for layout purposes.
- Create areas to display a record's fields or information.
- Create navigation buttons.
To create a layout area on the details page: - Drag the Table object from the Basic set of the Objects palette to the Layout Editor. You may want to use the Table Inspector to format the table.
Then you can add objects to your layout that display fields of a record from your database. - Drag Dynamic Content objects as needed or appropriate for the kinds of fields you want to display from the Dynamic Content set of the Objects palette.
- Bind the objects to fields in your content source as necessary.
- Click the Preview tab of the document window to see the first record in your database displayed in place of the mock content.
Generally, being able to view the first record in a database is not useful. You can add some navigation buttons that let you browse through the database's records.
To create navigation buttons: - Drag the Show Previous Record object from the Dynamic Objects set of the Objects palette to just below the table layout you created earlier.
- Drag the Show Next Record object from the Dynamic Objects set of the Objects palette to just the right of the Show Previous Record button you created.
- Type FIRST before the Show Previous Record button, and select it.
- In the Text Inspector, link to the current page.
- In the Dynamic Bindings palette, click Link Action, and then choose Show First Record from the pop-up menu. Select a content source.
- Type LAST after the Show Next Record button and select it.
- In the Text Inspector, link to the current page.
- In the Dynamic Bindings palette, click Link Action, and then choose Show Last Record from the pop-up menu. Select a content source.
|