TWiki Image Gallery Plugin
Pages containing
%IMAGEGALLERY% variables are expanded at view time, providing a thumbnailed image gallery for those images attached to a wiki page. Thumbnails are created automatically and subsequently cached. Display is simple ( trivial--probably not really good enough, although each picture is surrounded by a
span with a class of
imgGallery )
- size
> =small, medium, large, xlarge, huge
- web => web; default is %WEB%
- topic => topic; default is %TOPIC%
- format => how to format each image (see Variables), default format is:
<span class="imgGallery"><a href="$imageurl"><img src="$thumburl" title="$sizeK: $comment"/></a></span>$n
- options => additionaly oprins for the CONVERT program, default is "" (empty)
- columns => number of columns default is "0" which means infinity
if set to some number, the following sequence is generated:
$rowstart$format$rowinside$format ... $format$rowend
- rowstart => formatted text at start of a row if columns > 0, default is "" (empty)
- rowinside => formatted text inside of a row if columns > 0, default is "" (empty)
- rowend => formatted text at end of a row if columns > 0, default is "" (empty)
- rowinsideempty => formatted text inside of a row if columns > 0 and no more images, default is "" (empty)
- rowendempty => formatted text at end of a row if columns > 0 and no more images, default is "" (empty)
Variables
Variables are recognized and replaced in the format strings:
format,
rowstart,
rowinside,
rowend,
rowinsideempty,
rowendempty
-
$web the %WEB% the image is from
-
$topic the %TOPIC% the image is from
-
$width width in pixels of the original image
-
$height height in pixels of the original image
-
$version version number of the ioriginal mage
-
$name complete name of the original image (no path)
-
$sizeK size of the original image in kilobytes (example: 8k)
-
$size size of the original image in bytes (example: 8234)
-
$comment the comment of the image attachment
-
$wikiusername the WikiName of the user checked in the image
-
$username the user name of the user checked in the image
-
$thumburl the complete URL of the thumbnail image
-
$imageurl the complete URL of the original image
-
$date{...} the check in date of the original image, can be formatted like %GMTIME% (see TWikiVariables). The default format is like (if no {} spezified) "31 Dec 2002 - 19:30"
-
$n insert a line break
-
$imgnr number of the image (starts at 1)
Examples
%IMAGEGALLERY%
%IMAGEGALLERY{ web="%WEB%" topic="%TOPIC%" size="small" }%
%IMAGEGALLERY{ web="Saneasylum" topic="ArtworkGallery" size="x50" }%
Generates a table with 4 rows, images are centerd and with a tooltip. Below each image is a simple description line with a image number.
%IMAGEGALLERY{columns="4" rowstart="| " rowinside=" | " rowend=" |$n" rowinsideempty=" |" rowendempty=" |$n"
format="<span class='imgGallery'><a href='$imageurl'><img src='$thumburl' title='$tooltip'/></a></span><br/>$imgnr: $comment"}%
 1: | | | |
Format the Images as a list, images have tool tips.
%IMAGEGALLERY{format=" * <span class='imgGallery'><a href='$imageurl'><img src='$thumburl' title='$tooltip'/></a></span> $wikiusername $date$n"}%
-
WillNorris? 01 Aug 2003 - 23:35
Format the Images as a list, images have tool tips and customized date.
%IMAGEGALLERY{format=" * <span class='imgGallery'><a href='$imageurl'><img src='$thumburl' title='$tooltip'/></a></span> $wikiusername $date{$year$mo$day-$hour:$min:$sec}$n"}%
-
WillNorris? 20030801-23:35:05
ImageGalleryPlugin Settings
Plugin settings are stored as preferences variables. To reference
a plugin setting write
%<plugin>_<setting>%, i.e.
%IMAGEGALLERYPLUGIN_SHORTDESCRIPTION%
- Names and sizes for thumbnails (feel free to add additional entries or to modify these defaults)
- Set TINY = 25x25
- Set SMALL = 50x50
- Set MEDIUM = 95x95
- Set LARGE = 150x150
- Set XLARGE = 250x250
- Name and location of program used to generate thumbnails
- Set IMAGE_MAGICK = /usr
- Set CONVERT = /usr/bin/convert
- Set IDENTIFY = /usr/bin/identify
- Additionaly program options for the CONVERT program
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Displays image gallery with auto-generated thumbnails for attachments.
- Debug plugin: (See output in
data/debug.txt)
Plugin Installation Instructions
- Download the ZIP file from the ImageGalleryPlugin home
- Unzip
= ImageGalleryPlugin.zip= in your twiki installation directory. Content:
| File: | Description: |
data/TWiki/ImageGalleryPlugin.txt | Plugin topic |
data/TWiki/ImageGalleryPlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/ImageGalleryPlugin.pm | Plugin Perl module |
pub/TWiki/ImageGalleryPlugin/twikiwide.gif | test image for this page |
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins
--
WillNorris? - 1 Aug 2003