Tags:
images1Add my vote for this tag create new tag
, view all tags

ImgPlugin

Allows TWiki variable-style insertion of images in topics

Introduction

This is a fairly winky-dink plugin that allows people to use %IMG{"foo.gif"}% instead of using HTML syntax. It allows specification of the standard attributes as well as an optional web=<web> and/or topic=<topic>.

Syntax Rules

  • image name is mandatory, web and/or topic optional (defaulting to the current web and topic respectively
  • Supports the img attributes 'align', 'border', 'height', 'width', 'id', and 'class
  • Always puts in an alt tag with a value of '' if not specified. This is per XHTML spec.

Argument Meaning Default Required
name attachment name none yes
web web name of the attachment current web no
topic topic name of the attachment current topic no
alt alternate text tag '' no
caption caption to go with the image none no
captionplacement one of right, left, top, bottom right no

One good addition would be the auto-addition of the image size when possible, since I believe that pages load faster that way. This may require imagemagick, however.

Examples

  • %IMG{"foo.gif"}%
  • %IMG{"foo.gif" topic="ADifferentTopic"}%
  • %IMG{"foo.gif" align="right"}%

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %IMGPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Allows TWiki variable-style insertion of images in topics

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Plugin Installation Instructions

Note: 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.

  • Download the ZIP file from the plugin web (see below)
  • Unzip ImgPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/ImgPlugin.txt Plugin topic
    lib/TWiki/Plugins/ImgPlugin.pm Plugin Perl module
  • Configure the Plugin:
    • Run the configure script to enable the plugin
    • Change the plugin settings as needed
  • Test if the installation was successful:
    • %IMG{ "Smile.gif" web="TWiki05x01" topic="FileAttachment" }% renders as %IMG{ "Smile.gif" web="TWiki05x01" topic="FileAttachment" }%

Plugin Info

Plugin Author: TWiki:Main.MeredithLesly
Copyright: © 2006, TWiki:Main.MeredithLesly
© 2006-2010 TWiki:TWiki/TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2010-11-09 (V1.1)
Change History:  
2010-11-09: Doc improvements
2006-02-21: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Benchmarks: GoodStyle nn%, FormattedSearch nn%, ImgPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ImgPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ImgPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/ImgPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

Topic attachments
I Attachment Action Size Date Who Comment
Unknown file formatmd5 ImgPlugin.md5 manage 0.1 K 2010-11-09 - 08:52 PeterThoeny  
Compressed Zip archivetgz ImgPlugin.tgz manage 4.7 K 2010-11-09 - 08:51 PeterThoeny  
Compressed Zip archivezip ImgPlugin.zip manage 6.1 K 2010-11-09 - 08:51 PeterThoeny  
Unknown file formatEXT ImgPlugin_installer manage 3.3 K 2010-11-09 - 08:52 PeterThoeny  
Topic revision: r23 - 2011-08-23 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by PerlIdeas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.