SourceForge.net Logo WebAlbum
Home Screenshots Download Credits Documentation Contact

DOCUMENTATION



 

A Simple Walkthrough

Let's assume your photos are kept in a directory named c:\photos. They can be organized is subfolders like c:\photos\2000, c:\photos\2001, ...

  1. When you launch WebAlbum for the first time, a popup window opens and asks your source directory. Click the browse button and select c:\photos and click the OK button.
  2. You can now preview your pictures. For each folder, you can add a title and a description and for each photo, you can add a description. They are saved in the working directory when you save.
  3. Try to generate your pages. Select "generate" and click "start". Be sure to check "Use the default template". If it works properly, you should have your pages generated in the webalbum/target folder.
  4. Click on files and see the generated files. Double-Click on one to see the result

 

The WebAlbum Project

A project consists of several parameters which describe your project:

  • The source directory is where you keep your photos. This directory must exist and can have as many subfolders as wanted. The generation will keep a similar structure.
  • The working directory is the directory used to keep the webalbum informations. That's where folders' names, photos' description, custom templates are kept. It is also used as a cache for the photos' thumbnails. This directory will be created if it does not exist.
  • The target directory is where you webpages will be generated. Existing files will be overwritten but not deleted during the generation

The source directory will never be modified (you cannot delete pictures) except if you decide to rename a folder, to create a folder or to move a photo to an other folder. You cannot lose or modify a photo accidentally.

 

The FTP configuration is where you want to copy your pictures. Most Internet Access Provider grant you an FTP access when you register.

 

The WebAlbum Engine

The WebAlbum Engine is responsible for the webpages' generation. Pages are generated in the "target directory" specified in the configuration.

When you select the "Engine" tab, you can either generate all folders (recommended) or just one. Click the start button to start the generation. By default only the default template will be generated but you can select as many as you want and create yours in the "advanced mode".

Upon generation, you can check what the engine is doing: photo compression, resizing, template parsing. The engine skips templates without stopping when errors are found (the errors are highlighted in red in the window).

 

The WebAlbum Templates

To activate this feature you must switch to the advanced mode: menu -> "project" -> check "advanced mode"

Tutorial

Each folder can support an unlimited number of folders:
- local templates can only be generated within the local folder.
- global templates can be generated within all folders.
- default templates are packaged in the application and cannot be modified.

 

Templates are written through the Velocity language (VTL). The syntax can be checked here

  • To generate all pictures in a given folder, you can use the following template (5 lines are enough!!)
<!-- Folder informations -->
$folder.title <br>
$folder.description <br> <!-- Display each photo resized to a a width or heigth of 200 --> #foreach ($asset in $folder.assets) <a href="href="$asset.image()"" <img src="$asset.image(200,200)" alt="$asset.description"> </a> #end
  • You can also add a navigation bar to an other folder or to an other template
<!-- Add a link to the parent folder if needed -->

#if ($folder.parent)
  Parent folder: <a href="$folder.parent.getLink()"> $folder.parent.title <br>
#end

<!-- Link to this file -->
This file: <a href="$folder.getLink()"> $folder.title <br>

<!-- Links to each subfolder -->
#foreach ($sub in $folder.subFolders)
  Sub: <a href="$sub.getLink()"> $sub.title <br>
#end

  • Multipage: a template can be used to generate several pages. To specify the number of pages, you have to set up " $engine.nPages ".
#set ($photoByPage = 12)
#set ($engine.nPages = ( $folder.assets.size() - 1) / ( $photoByPage ) + 1)

<!-- Index -->
#foreach ($i in [1..$engine.nPages])
  #if($page == $i) 
    $i
  #else
    <a href="$folder.getLink($i)"> $i </a> 
  #end
#end

 

 

 

Template Reference

## The variables that can be set up are:
 $engine.nPages: the number of pages generated by this template (default = 1)


## The variables that can be accessed directly from the template are:
 $page   : the page number (starts at 1) 
 $folder : the current Folder's object
 $engine : the Engine object 

## Folder's properties
 $folder.title : either the folder title or the folder name (if title is null)
 $folder.description
 $folder.assets : the list of Photos contained in this folder
 $folder.assets.size() : the number of assets
 $folder.subFolders : the list of sub Folders' objects
 $folder.parent : the parent Folder's object (may be null)
 $folder.getLink() : the filename of the 2nd page generated by the current template
 $folder.getLink("album") : the filename of the first page generated by the "album" template
 $folder.getLink(2) : the filename of the 2nd page generated by the current template
 $folder.getLink("album", 2) : the filename of the 2nd page generated by the "album" template
 $folder.hasTemplate("album") : true if the folder uses the "album" for its generation

## Photo's properties
 #foreach ($asset in $folder.assets)
 $asset.date : the date of this photo formatted to the local format
 $asset.description : the description of this photo
 $asset.image() : the relative link to the original photo (copied to the target directory)
 $asset.image(width, height) : the relative link to the resized photo (quality=75)
 $asset.image(width, height, quality) : the relative link to the resized photo
 #end

## Engine's properties
$engine.nPages : the number of pages generated by this template
$engine.homepage : a link to this homepage
$engine.fullVersion : "WebAlbum version..."
$engine.version : the WebAlbum version

 

 

 

 

The WebAlbum Publication Tool


More resources available on sourceforge