![]() |
![]() |
![]() |
|
![]() |
|||
![]() |
|||
![]() |
GoLive 6 Dynamic Content Samples | ||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
||||||
Main View | Administration View | How it Works | ||||||
![]() |
||||||||
![]() |
|
There is one table and one query. The PhotoData table keeps track of all the information about photos, and the Photos query generates the derived image names for the small, medium, and large images. It also filters the records in the PhotoData table so that it only returns the photos that should be displayed. PhotoDataEach photo has a caption, a date, and a boolean value that indicates whether or not to display it. There is also a unique ID field identifier. GoLive automatically adds references to the ID field whenever a page uses Show Details of Current Record. The Filename field contains a base file name for each photo. The small, medium, and large image files are all derived from this single base name. PhotosThe Photos query is based on the PhotoData table. It uses computed query fields to generate the file names for the three different images sizes. In this sample the different images sizes are organized into folders, so the small image for 'flower.jpg' is 'images/small/flower.jpg'. The technique of creating computed fields also works if the images are organized by suffix, for example 'images/flower-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 computed fields have a syntax that looks like this:
If you were using a suffix naming convention, the computed fields would look like this:
Note that in the first case Filename already contains the appropriate .gif or .jpg file extension, whereas in the second case it does not. It is possible to create computed fields to implement any kind of naming convention. In addition to generating the derived file names, the Photos query also filters out the photos that should not be displayed. Doing the filtering in the database like this usually leads to simpler designs than the alternative of filtering the records in GoLive. Unfortunately, the syntax for constructing a filtered query is different from database to database, so you need to check your database documentation to learn how to create one. |