Adobe
GoLive 6 Dynamic Content Samples
Overview
Database Design
Front Page
Story
List Stories
Publish Stories
Edit Story

A. Dynamic table to display story titles. B. Template row with title and link to full story. C. Custom code to rewind Stories content source to lead story. D. Title, summary, and image for lead story. E. Link to lead story.

Content Sources

Front Page contains a single content source: the Stories table from the Stories database. Because the front page only displays stories that are being published, the query uses record filtering to limit the query results. Here is what the inspector palette looks like:

The match patterns for the ShouldPublish and WorkflowStatus fields limit the records that come back from the query. Notice the syntax: the WorkflowStatus pattern uses single quotes around the text string 'Ready to Publish'; the ShouldPublish pattern does not use quotes around the boolean value true. In general, match patterns should use single quotes for text fields, and not use quotes for boolean and numeric fields.

The Stories content source is sorted by priority so that the lead story appears in the center of the page.

A.

The left side of the page contains a dynamic table that displays the titles of the stories. Since we only want the title of the lead story to appear in the center of the page, the Dynamic Binding for the table uses the First Record/Last Record option to start at story number 2. The table rows have alternating colors so that they are visually distinct.

B.

The title text in the template row is bound to the Stories.Title field to display a story's title. It is also a link to the story.asp page. The link uses Show Details of Current Record so that when the user clicks on a story, the story.asp page automatically shows the story that the user clicks.

C.

There is hidden code here to rewind the Stories content source. We have just displayed the story titles in the dynamic table on the left, so the Stories content source is now pointing to the end of the record set. We need to go back to the beginning to display the lead story. Here is what the code looks like in ASP:

<% Stories.MoveFirst %>

This same code will work for any content source; simply replace 'Stories' with the name of the content source you need to rewind.

D.

The elements in the center of the page are simple bindings to display the title, summary, and image for the lead story.

E.

The full story link at the bottom of the page points to the story.asp page. It uses Show Details of Current Record so that when the user clicks on the link, the story.asp page automatically shows the lead story.