Adobe
GoLive 6 Dynamic Content Samples
Overview
Database Design
Browse
Catalog Item
Find Items
Edit Item

text

There are three tables and one query. The Sections table contains information about catalog sections; the ProductData table contains information about products. The relationship between the two indicates that every product is in a section, and that a section can contain more than one product.

BlankSection is a special table used to construct the query-by-example Find Items page. The Products query repeats the fields from the ProductData table and adds a small and large image for each product.

Sections

The Sections table lists all of the sections by name. The advantage of having these names in a separate table is that we can dynamically construct a table of contents in the Main View that shows the sections.

BlankSection

The query-by-example page has a pulldown menu for finding the products in a catalog section. Because the user might want to leave this pulldown blank, the menu of section names needs to include a blank entry. The blank entry comes from the BlankSection table. The Find Items page uses a UNION query to combine the blank entry with the rest of the names in the Sections table.

ProductData

Each product has a name, a price, a description, a small and large image, and a catalog section in which it appears. There is also a unique ID field. GoLive automatically adds references to the ID field whenever a page uses Show Details of Current Record.

Because the small and large images are related by a naming convention, the ProductData table only keeps track of a single image name. The Products query reconstructs the actual file names.

Products

The Products query uses computed fields to generate the small and large image file names for each product. In this sample the two image sizes are organized into subfolders, so the image name 'trip.jpg' goes with the images 'images/small/trip.jpg' and 'images/large/trip.jpg'. The technique of generating file names with computed fields would also work if the images were organized by suffix, for example 'images/trip-small.jpg'.

The method for creating computed fields is unfortunately different from database to database, so you need to check your database documentation to learn how to create one. Using Microsoft Access, the two image fields have a similar syntax. The small image looks like this:

Small: "images/small/" & [ImageName]

If you were using a suffix naming convention, the small image would look like this:

Small: "images/" & [ImageName] & "-small.jpg"

Note that in the first case ImageName already contains the appropriate .gif or .jpg file extension, whereas in the second case it does not. It is possible to create computed fields like these to implement any kind of naming convention.