Tags:
create new tag
, view all tags

RandomQuotePlugin

Display a random quote

Syntax Rules

The %RANDOMQUOTE{...}% variable gets expanded to a random quote selected from a RandomQuotes page.

%RANDOMQUOTE%
Parameter
Sorted ascending
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 $variablesSorted ascending 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="Sandbox" quotes_file="NotableQuotes" }%

%RANDOMQUOTE{ web="Sandbox" quotes_file="NotableQuotes" }%

%RANDOMQUOTE{ web="Main" }%

%RANDOMQUOTE{ web="Main" }%

%RANDOMQUOTE{ format="<p><cite>$saying</cite></p><p align='right'>- $author</p>" }%

%RANDOMQUOTE{ format="

$saying

- $author

" }%

RandomQuotePlugin Global Settings

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

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Display a random quote

  • 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 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 RandomQuotePlugin data topic
    data/TWiki/RandomQuotePlugin.txt Plugin topic
    data/Sandbox/NotableQuotes.txt Sample quotes
    lib/TWiki/Plugins/RandomQuotePlugin.pm Plugin Perl module
  • Test if the installation was successful:
%RANDOMQUOTE{}%

Plugin Info

Plugin Author: TWiki:Main.JasonTromm
Copyright: © 2003, TWiki:Main.JasonTromm
© 2006-2010 TWiki:TWiki/TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2010-11-10 (V1.0)
Change History:  
2010-11-10: TWikibug:Item6530: Doc improvements
2003-07-03: Initial version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Plugin Home: http://twiki.org/cgi-bin/view/Plugins/RandomQuotePlugin
Feedback: http://twiki.org/cgi-bin/view/Plugins/RandomQuotePluginDev

Related Topics: TWikiPreferences, TWikiPlugins

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 RandomQuotePlugin.md5 r3 r2 r1 manage 0.2 K 2010-11-11 - 05:49 PeterThoeny  
Compressed Zip archivetgz RandomQuotePlugin.tgz r3 r2 r1 manage 6.3 K 2010-11-11 - 05:49 PeterThoeny  
Compressed Zip archivezip RandomQuotePlugin.zip r3 r2 r1 manage 8.6 K 2010-11-11 - 05:49 PeterThoeny  
Unknown file formatEXT RandomQuotePlugin_installer r3 r2 r1 manage 3.5 K 2010-11-11 - 05:49 PeterThoeny  
Edit | Attach | Watch | Print version | History: r15 < r14 < r13 < r12 < r11 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r15 - 2013-10-16 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2016 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.