TWiki
>
TWiki/ Web
>
AttachLinkPlugin
(01 Sep 2010,
TWikiAdminGroup
)
(raw view)
E
dit
A
ttach
---+!! <nop>%TOPIC% <!-- Contributions to this plugin are appreciated. Please update the plugin page at http://twiki.org/cgi-bin/view/Plugins/AttachLinkPlugin or provide feedback at http://twiki.org/cgi-bin/view/Plugins/AttachLinkPluginDev. If you are a TWiki contributor please update the plugin in the SVN repository. --> %SHORTDESCRIPTION% <div style="float:right; background-color:#eeeeee; margin:0 0 20px 20px; padding: 0 10px 0 10px; width:380px"> %TOC{title="Page contents"}% </div> ---++ Syntax Rules %<nop>ATTACHMENT{ name="filename" topic="TopicName" web="Webname" label="sometimes_text_sometimes_magic" }% This apparently trivial plugin turns out to be quite useful. Besides syntactic sugar, it actually makes previously hard things easier! Until now, referencing an attachment in a TWiki topic has required escape to HTML, with lots of ugly TWiki variables like %<nop>PUBURLPATH% and %<nop>ATTACHURL% to do the simplest things. AttachLinkPlugin fixes that! Further, it makes it easy to have clickable images - for example, thumbnails that when clicked, expand to a full-size picture. Here are the syntax details: * name - The filename that you upload. Just the name, no path. The name= is optional, but the quotes are not. * topic - the topic that manages the attachment. The default is the current topic, so you can usually omit this. * web - the web that contains the topic that manages the attachment. The default is the current web, so again, you can usually omit this. * label - the thing that you want visible to represent the link. This can be text - or another object. The default is the filename, so you can omit it too. See the examples for details. ---++ Examples %<nop>ATTACHMENT{ "foo.jpg" }% Create a link to foo.jpg in the current topic, which will look like: %BLUE%foo.jpg %ENDCOLOR%underlined. (Can WYSIWYG underline?) %<nop>ATTACHMENT{ "foo.jpg" label="The foomobile afloat" }% gives you a hyperlink to the same file, like this: %BLUE%The foomobile afloat%ENDCOLOR% %<nop>ATTACHMENT{ "foo.jpg" label="%<nop>IMG{ "foo_thumb.jpg" align="left" width="40" class="none" }%" }% will display foo_thumb.jpg inline. You can click on the image, and if you do, foo.jpg will display. So you essentially have the power of ![[%SYSTEMWEB%.WikiWord][PrettyText]] links, for images and other attachments. And anything else that will take an HTML anchor tag. A rather surprising result for less than 10 executable statements of perl. If %<nop>ATT% is not in use (do we have a registry of variables?), I would be receptive to adding the line to add it as an alias for %<nop>ATTACHMENT% - I already have 10s of thousands of instances of %<nop>ATTACHMENT% Enjoy it as much as I do. ---++ Plugin Settings Plugin settings are stored as preferences variables. To reference a plugin setting write =%<nop><plugin>_<setting>%=, i.e. =%<nop>ATTACHLINKPLUGIN_SHORTDESCRIPTION%= * One line description, is shown in the %SYSTEMWEB%.TextFormattingRules topic: * Set SHORTDESCRIPTION = Painless links to attachments * There are no other settings for this plugin. ---++ 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 Home (see below) * Unzip *%TOPIC%.zip* in your twiki installation directory. Content: | *File:* | *Description:* | | ==data/TWiki/%TOPIC%.txt== | Plugin topic | | ==lib/TWiki/Plugins/%TOPIC%.pm== | Plugin Perl module | * Configure the Plugin: * Run the [[%SCRIPTURL{configure}%][configure]] script to enable the plugin * Change the plugin settings as needed * Test if the installation was successful: * _enter samples here_ ---++ Plugin Info | Plugin Author: | TWiki:Main.TimotheLitt | | Copyright: | © 2007, TWiki:Main.TimotheLitt, %BR% © 2007-2010 TWiki:TWiki.TWikiContributor | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | Plugin Version: | 19310 (2010-08-01) | | Change History: | <!-- versions below in reverse order --> | | 2010-08-01: | TWikibug:Item6530 - doc fixes; changing TWIKIWEB to SYSTEMWEB | | 20 Dec 2008: | Initial version | | TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 | | CPAN Dependencies: | none | | Other Dependencies: | none | | Perl Version: | 5.005 | | TWiki:Plugins/Benchmark: | %SYSTEMWEB%.GoodStyle nn%, %SYSTEMWEB%.FormattedSearch nn%, %TOPIC% nn% | | Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | | Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal | __Related Topics:__ %SYSTEMWEB%.TWikiPlugins, %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.TWikiPreferences
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 01 Sep 2010 - 15:01:49 -
TWikiAdminGroup
TWiki/
Log In
or
Register
TWiki/ Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
QuerySearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
Abacos
Acbahia
AnpedGT16
ArcoDigital
Argumento
Avsan
CalculoB
Ceb
Cetad
CetadObserva
Cibercultura
Ciberfem
CiberParque
ColoquioCiags
Coloquiofasa
ConexoesSaberes
Cpdteste
Cppd
Creche
Cridi
Da
DACN
DCE
DelzaTeste
DeniseCarla
DepHistoria
DicionarioBelasartes
Ecologia
EDC
Educandow
EduMus
EleicoesReitor2010
Encima
Enearte
Estruturas
EstruturasEng
FACED
FAT
FepFaced
GEC
GeneticaBiodiversidade
GeneticaBiodiversidade3
GeneticaBiodiversidade
Gepindi
GetecEng
Godofredofilho
GrupoAlgebra
ICI010
Informev
Ites
LabioComp
LEG
Lepeja
Letras
LivroLivreSalvador
Main
MaisUm
Mata07
Mefes
MefesCpd
MetaReciclagem
Neclif
NelsonPretto
Nuclear
Numcad
Nutricao
Observa
OrfaosdeRua
PauloCostaLima
PdI
PescandoLetras
PETFilosofia
Pgif
PGNUT
PortalPpga
PosCultura
Pospetroigeo
PPGAC
PPGE
PpggBio
Ppggenbio
Pretto
Proad
PROGESP
ProjetoLencois
Quimica
RadioFACED
RadioTeatro
RadioWeb
Riosymposium10
Ripe
Salasdoctai
Sat
Sedu
SemBio
SeminarioPibid
SimoneLucena
Sociologia
SSL
Tabuleiro
TabuleirosUfba
TCinema
TerritoriosDigitais
TWiki
Twikidea
UFBAIrece
UniversidadeNova
VizinhoEstrangeiro
XIISNHCT
Български
English
Español
日本語
Português
Copyright � by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback