
Adobe
This tutorial describes how to incorporate the Spry framework into a static HTML page in order to create a dynamically generated web photo album. The Spry framework allows users to dynamically load and incorporate XML data into an HTML page with a minimal amount of markup. After developing the functionality of the photo album, CSS is used to create a variety of different layouts for the same basic HTML page.
In this project, the index page of the photo album will display both the thumbnails and the first large image. When the user clicks on a thumbnail image on the index page, the corresponding larger version of that image will display in place of the first image. Traditional web photo albums usually consist of several static web pages, (usually one page per image in the album) along with the images themselves. These pages are usually identical with the exception of their URL, which changes depending on the current large image being viewed. In a traditional photo album, when the user clicks on a thumbnail, (or clicks the next or previous button) on one of the album pages, a completely new HTML page is fetched and loaded into the browser to display the next image. This tutorial uses a different convention—rather than updating the whole page, only the new larger image is reloaded via Ajax. This approach provides a faster display of the images and results in a smoother user experience when reviewing the photos. The Spry framework is very helpful in this situation, because it makes it possible to create a very flexible page that dynamically displays images using only a few lines of code.
If you haven’t already, download the source files for this tutorial and uncompress the zip file. The sample file folder contains the following:
The Spry framework is a JavaScript library that contains all the functions needed for using XML data on the photo album page.
Here’s a list of terms that will be used in this tutorial:
{dataSetName::columnName}. If a dynamic region is bound to only one data set, data references can use the short hand notation instead: {columnName}It is important that you are familiar with these terms and concepts to follow along with this tutorial. Now let’s start the project.
To complete this tutorial you will need to install the following software and files:
Donald started his career working in Technical Support for Dreamweaver, Contribute and Authorware among other products. He joined the Dreamweaver Quality Engineering team 2 1/2 years ago. He has been a core member of the Spry team since its inception. Check out his travel photos at http://www.dbooth.net.