You are here: TWiki> Plugins Web>RandomTopicPlugin (2008-12-12, SopanShewale)
Tags:
navigation1Add my vote for this tag create new tag
, view all tags

RandomTopicPlugin

Pick and display some random topic names/links.

( Discussion in TWiki:Plugins/RandomTopicPluginDev )

Syntax Rules

  • %RANDOMTOPIC% - inserts a single random topic name in it's place.
  • %RANDOMTOPIC{params}% - inserts potentially more than one random topic, with user formatting. Parameters:
    • topics="5" - Number of topics requested. Default is 1 topic
    • include="^Web" - Perl regular expression. Only topics that match this expression will shown_. Default is set by RANDOMTOPICPLUGIN_INCLUDE (see below).
    • exclude="^Web" - Perl regular expression. Any topics that match this expression will never be shown. Default is set by RANDOMTOPICPLUGIN_EXCLUDE (see below).
    • format=" format string " . The format string accepts 3 quoted parameters:
      • $t will be expanded to \t (necessary for bullet lists)
      • $n will be expanded to \n (So that things appear on separate lines - again for bullet lists
      • $topic will be expanded to the randomly chosen name
      • Default is a bullet list : "$t* $topic$n"

Examples

  • %RANDOMTOPIC{topics="5"}% - 5 random topics as a bullet list
  • %RANDOMTOPIC{topics="5" format="| *$topic* | $topic|$n"}%
    • Provides 5 random topics.
    • They will be formatted to look like this:
TWikiMetaData TWikiMetaData
TWikiTemplates TWikiTemplates
TWikiUserAuthentication TWikiUserAuthentication
HiddenAttachment HiddenAttachment
WikiName WikiName
  • %RANDOMTOPIC{topics="10" exclude="^Web"}% - 10 random topics, excluding any that start with "Web".

RandomTopicPlugin 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 = Pick a selection of Random Topics
  • Perl regular expression matching topics to be selected from
    • Set INCLUDE =
  • Perl regular expression matching topics to be excluded
    • Set EXCLUDE = ^Web

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 RandomTopicPlugin.zip in your twiki installation directory. Content:
File: Description:
./lib/TWiki/Plugins/RandomTopicPlugin/build.pl Build script
./lib/TWiki/Plugins/RandomTopicPlugin.pm Plugin code
./data/TWiki/RandomTopicPlugin.txt Plugin topic
RandomTopicPlugin_installer.pl Install script

  • Test if the installation was successful:
    • If you see a table below of 5 random topics then you have successfully installed this:

%RANDOMTOPIC{topics="5" format="| $topic |$n"}%

Plugin Info

Plugin Author: TWiki:Main/MichaelSparks
License: GNU Public License (GPL)
Plugin Version: 1.200
Change History:
15 Nov 2004 1.200 Crawford Currie - removed non-functional persist option, added exclude and include parameters, ported to Cairo & BuildContrib build system, add to CVS.
10 Jul 2003 1.010 Initial version
Dependencies: None
Perl Version: 5.005
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/RandomTopicPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/RandomTopicPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

-- TWiki:Main/MichaelSparks - 10 Jul 2003
-- TWiki:Main/CrawfordCurrie - 13:13:25 15 November 2004

Topic attachments
I Attachment Action Size Date Who Comment
elsemd5 RandomTopicPlugin.md5 manage 0.2 K 2008-12-12 - 11:56 SopanShewale checksum file , Uploaded as a part of Release Process
ziptgz RandomTopicPlugin.tgz manage 4.2 K 2008-12-12 - 11:56 SopanShewale See RandomTopicPlugin for details. Untar and run the installer script, Uploaded as a part of Release Process
zipzip RandomTopicPlugin.zip manage 5.6 K 2008-12-12 - 11:56 SopanShewale See RandomTopicPlugin for details. Unzip and run the installer script , Uploaded as a part of Release Process
elseEXT RandomTopicPlugin_installer manage 3.4 K 2008-12-12 - 11:56 SopanShewale Installer Script, Uploaded as a part of Release Process
Topic revision: r10 - 2008-12-12 - 11:56:31 - SopanShewale

 
TWIKI.NET