RandomQuotePlugin
Retrieve a random quote from a specially formatted TWiki topic and display on a TWiki page
Syntax Rules
The
%RANDOMQUOTE{...}% variable gets expanded to a random quote selected from a
RandomQuotes page.
%RANDOMQUOTE% Parameter | Explanation | Default |
format | Format of one item. Can include variables in the table below. | "\"$saying\"--$author" |
quotes_file | Alternate name for the random quotes topic | RandomQuotes |
web | Name of the web where the random quotes topic is stored. | Main |
Format $variables | Description |
| $author | Who said it? |
| $category | What type of quote is this? (could be used to match with Topic Classification) |
| $saying | Text of the random quote |
Examples
%RANDOMQUOTE{ web="Main" quotes_file="JunkQuotes" }%
Topic JunkQuotes? does not exist!
%RANDOMQUOTE{ web="Main" }%
"JAY, YOUR MOTHER IS ON THE PHONE"--Paul (over the loudhailer from the club house to Jay out the back on a boogie board)
%RANDOMQUOTE{ format="<p><cite>$saying</cite></p><p align='right'>—$author</p>" }%
|
JAY, YOUR MOTHER IS ON THE PHONE
—Paul (over the loudhailer from the club house to Jay out the back on a boogie board)
RandomQuotePlugin Global Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%INTERWIKIPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = display a random quote
- Debug plugin: (See output in
data/debug.txt)
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 server where TWiki is running.
- Download the ZIP file from the Plugin web (see below)
- Unzip
RandomQuotePlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/Main/RandomQuotes | RandomQuotesPlugin? data topic |
data/TWiki/RandomQuotePlugin.txt | Plugin topic |
data/TWiki/RandomQuotePlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/RandomQuotePlugin.pm | Plugin Perl module |
- Test if the installation was successful:
"JAY, YOUR MOTHER IS ON THE PHONE"--Paul (over the loudhailer from the club house to Jay out the back on a boogie board)
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins
--
JasonTromm - 03 Jul 2003