NeoPhoto: Software for sharing photos with Family and Friends.
NeoPhoto

3.4. Creating a Thumbnail Index Page using the IndexPage Tag

Most web albums consist of one or more pages of thumbnails, possibly with titles, that are linked to larger versions of the photos. The IndexPage tag and it's children are used to create thumbnail index pages.

In the tutorial_simple template, there is only one page of thumbnails. In a more complicated example you might have mulitple pages of thumbnails with next and previous buttons along with possibly a list of pages. Those options will be discussed later in this document. For now we'll just focus on the basics.

3.4.2. Header

The <Header> tag, which is required and must be a child of the IndexPage tag, is used to describe the HTML that will be displayed at the top of the page before any thumbnails are displayed. Typically this is where you output your HTML start tags, your title and your introductory text. It has no attributes.

The text content under the <Header> tag is the HTML you wish to have displayed at the top of the page.

From the tutorial_simple template:

<Header>
&lt;!-- You can include HTML comments in your templates along
with any other normal HTML you might want to include.
For tutorial purposes we have indented this file to make the
source easier to read. For a "real" template you would not want
to do this because including extra tabs and formatting confuses
many browsers.
Once you generate your web album using this theme these comments
will give you a good idea of which tags generate which sections
of HTML.
Header tag under the IndexPage START. --&gt;
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;{GalleryTitle}&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;body bgcolor="white"&gt;
&lt;center&gt;
&lt;table width="75%"&gt;
&lt;tr&gt;
&lt;td align="center"&gt;
&lt;p&gt;This album was generated using the tutorial_simple
template. It's intended to be a companion to the 
&lt;a href="http://www.neophoto.com/template_writers_guide.html"
target="_blank"&gt;template writers guide&lt;/a&gt;. 
To demonstrate what text is embedded in the template and what
text comes from the album, all text from the NeoPhoto album
has been put in italics.  All thumbnails come from the album. The
DTLink and NeoPhoto buttons come from the template.
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br&gt;
                        &lt;b&gt;&lt;i&gt;{GalleryTitle}&lt;/i&gt;&lt;/b&gt;
                        &lt;p&gt;&lt;i&gt;{GalleryDescription}&lt;/i&gt;&lt;/p&gt;
&lt;table width="100%"&gt;
&lt;tr&gt;
&lt;td colspan="2" align="center" valign="top"&gt;
&lt;!-- this shows how you can include stock graphics in your
templates. All graphics are referred to relatively and must be
present in the template folder. NeoPhoto will just copy all the
files in the template folder to the folder where the webpages are
created. --&gt;
&lt;a href="http://www.neophoto.com" target="_blank"&gt;&lt;img
border="0" src="neo.madewith.00.jpg"&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;!-- Header tag under the IndexPage END --&gt;
</Header>

Figure 3-7. <Header> tag example

You'll notice that all the “<” and “>” tags in the text content are encoded. The first item in the text content is an <HTML> tag, the second is an HTML comment, the second a <HEAD> tag, then comes the title and close tags. As you can see with the templates distributed with NeoPhoto, you can add a much more elaborate header but this suffices as a simple example.

3.4.5. Image

The Image tag is where you actually specify how a thumbnail should be rendered. There will be one Image tag for each thumbnail you want displayed in a given row. As a result the number of thumbnails that your template will display is fixed. However, because you describe a complete row of thumbnails with the use of multiple ImageRow tags you can have each row render it's thumbnails completely differently making it possible to create some novel designs.

The text content of the Image tag contains the HTML that outputs the given thumbnail. Although the size of the thumbnail is specified in the IndexPage tag you can also add a ThumbWidth and ThumbHeight attribute to the Image tag to override the default setting; so you can have each thumbnail sized differently.

There are a number of variables available under the Image tag which are not available elsewhere. These are the values the user has entered about this particular photo. These variables include:

  1. {ImageThumbFileName} the filename of the current thumbnail

  2. {ThumbWidth} the width of the thumbnail.

  3. {ThumbHeight} the height of the thumbnail.

  4. {ImageTitle} the title entered for this photo if any

  5. {ImageCaption} the caption entered for this photo if any

  6. {ImagePageFileName} the detail page to link this thumbnail to.

There are more variables. See the Template Variable Reference for more information. As you can see in the tutorial_simple example, these variables get substituted for each photo in the album. In the example, there are two Image tags under a single ImageRow. The first photo in the album is applied to the first Image tag. The next photo is applied to the next one and then the process repeats itself.

NeoPhoto will automatically create the thumbnails, give them names and provide that in the {ImageThumbFileName} variable. It will also automatically create any detail pages and provide their names in the {ImagePageFileName} variable.

As you can see if many of the templates provided with NeoPhoto you can become pretty elaborate with stock graphics and other adornments around each photo.

3.4.5.1. FixedContent under Image

If you have multiple Image tags in an ImageRow, what happens if you don't have enough photos to fill out a complete row. As you can see in the Tutorial Simple example, there are an odd number of photos. If NeoPhoto reaches the last photo in an album before reaching the end of the current ImageRow it will look for a FixedContent tag under the Image tag and will output that HTML instead of a photo. This allows you to cleanly end your row or possibly put something in place of photos to finish out the row. In the example, we've added a “Made with NeoPhoto” graphic in place of the photo to illustrate this point.

Because we named the tag here FixedContent it can be a little confusing. A FixedContent tag under an Image tag has a different meaning than a FixedContent tag under an ImageRow. Remember that the FixedContent under an Image tag is only used when NeoPhoto runs out of photos. The FixedContent tag under an ImageRow tag is always used.