Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Changed: | |||||||||||||||||||||||||||||||||||||
< < | -- TimotheLitt - 21 Dec 2008 | ||||||||||||||||||||||||||||||||||||
> > | ThumbnailPluginThumbnails for everyoneOn this page:
Syntax Rules%THUMBNAIL{ name="filename" variant="size" }%
Given an image file name, returns the name of its thumbnail file of the given size.
Normally, you don't give the size, as it will default from a preference variable. But if you want an especially large (or small) icon selectively, the syntax allows for that.
This plugin can be enabled on a per-topic, web, or site basis using the THUMBNAILPLUGIN_ENABLE preference variable.
When this plugin is enabled for a topic, any image attachment that is saved will have one or more thumbnails autogenerated for it. Image attachments types currently supported are: .jpg .gif .png
The thumbnail's size will be determined from the preference variable THUMBNAILPLUGIN_SIZE, which defaults to 150 (pixels).
Use multiple sizes for accessibility as well as for esthetics. However, they do take time to generate, so don't go too wild.
Used with the AttachLinkPlugin and ImgPlugin, it becomes easy to do things like display hyperlinks to images as thumbnails of that image. Examples below.
This plugin requires the GD![]() ![]() CAVEATThis is a working prototype. Because of limitations of the current plugin interface, thumbnail auto-creation is unclean.
Examples%ATTACHMENT{"foo.jpg" label="%IMG{"%THUMBNAIL{"foo.jpg"}%" align="left" }%"}%
This is equivalent to the previously-required HTML markup
<a href="%ATTACHURL%/foo.jpg"><img src="%ATTACHURL%/foo_thumbnail_150.jpg" align="left" /></a>
or the slightly better:
%ATTACHMENT{ "foo.jpg" label="%IMG{ "foo_thumb_150.jpg" align="left" width="40" class="none" }%}%
Of course, neither of the previous methods support multiple sizes as easily, nor are they as well abstracted from the attachment implementation.
Plugin SettingsPlugin settings are stored as preferences variables. To reference a plugin setting write%<plugin>_<setting>% , i.e. %NEWPLUGIN_SHORTDESCRIPTION%
Plugin Installation InstructionsNote: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
Plugin Info
![]() ![]() ![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > | -- TimotheLitt - 21 Dec 2008 |