The web pages jAlbum generates are based on "template pages" which can contain HTML and CSS code mixed with special tags, scripts and variables that are expanded to their values. When referring to a variable in HTML context, use the format ${variable}. In scripting context or when used in existence testing (see ja:if exists on the tags page) simply use variable name as is.
The following variables are defined. Note that case is significant:
1 Not defined if only one index page exist
2 Only defined if such page exist
3 Only exists for images containing EXIF/IPTC data and if EXIF extraction is turned on
You can list these variables and their current values by writing the following into a slide.htt template file:
<pre>${current}</pre>Apart from having access to ordinary variables when scripting, jAlbum also provide some special objects (Java type within parenthesis):
Note: "current", "previous" and "next" are accessible for slide pages or within a ja:coliterator or ja:fileiterator on index pages
The "meta" object usually contains more EXIF metadata than accessible from ordinary variables, but possibly in a more raw format. You may list all metadata found inside an image by putting the following code inside a slide.htt file:
<pre>${meta}</pre>The following example picks the "Owner Name" variable out of the meta object (assuming it exists, which it does for some Canon cameras):
${meta.Owner Name}Template file variables can be used anywhere where you can put text and html tags (HTML mode) and within <% scriptlets %> (BeanShell mode). In HTML mode, you have to use ${thisVariableFormat} to indicate is a variable, in BeanShell mode, just refer to the variable by its name.
Before any BeanShell scripts are processed for a certain page, jAlbum replaces any occurance of $variablesInThisFormat with their current values. This notation therefore works for refering to variables that aren't introduced or modified by a script. The replacement is a simple search & replace operation, so you can even use this syntax in a script. The only thing the script will see is the replaced value. Use with caution as errors are usually harder to debug when using this format.
jAlbum users can define new variables using the "User defined variables" table in the advanced section. These variables behave like other skin template variables and can also override existing variables. You can use user defined variables to add even more flexibility to the look of the skins you create. Usually, user defined variables become variables of String type nomatter what value they have (for backward compatibility). This isn't very convenient if you wish to work a lot with boolean or integer variables (requires type conversion). Automatic type conversion to boolean, integer and double is however performed if jAlbum senses that the particular skin has a custom user interface.
貢献