You are here: CTSPedia>System Web>RandomTopicPlugin (28 Mar 2010, WikiGuest?)EditAttach
create new tag
, view all tags, tagging instructions


Pick and display some random topic names/links.

Syntax Rules

  • %RANDOMTOPIC% - inserts a single random topic name in its 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 be 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"


  • %RANDOMTOPIC{topics="5"}% - 5 random topics as a bullet list * %RANDOMTOPIC{topics="5" format="| *$topic* | $topic |$n"}%
  • %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
  • Perl regular expression matching topics to be excluded

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 in your twiki installation directory. Content:
    File: Description:
    ./lib/Foswiki/Plugins/ Plugin code
    ./data/System/RandomTopicPlugin.txt Plugin topic

  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
  • Test if the installation was successful:
    • If you see a table below of 5 random topics then you have successfully installed this:


%RANDOMTOPIC{ format="$topic" }%

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


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

SiteTools SiteTools
TemplateTopics TemplateTopics
WebRssBase WebRssBase
PatternSkinWebCreateNewTopicTemplate PatternSkinWebCreateNewTopicTemplate

Plugin Info

Plugin Author: Foswiki:Main.MichaelSparks
Plugin Version: 6961 (2010-03-28)
Change History:
28 Mar 2010 1.3.0 port to Foswiki -- Foswiki:Main.WillNorris
27 Dec 2005 1.201 TWiki:Main.WillNorris - changed INCLUDE and EXCLUDE preferences (to INCLUDETOPICS and EXCLUDETOPICS) for Dakar compatability
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
Plugin Home:

Related Topics: DefaultPreferences, SitePreferences, Plugins

-- TWiki:Main/MichaelSparks - 10 Jul 2003
-- TWiki:Main/CrawfordCurrie - 15 Nov 2004
-- TWiki:Main/WillNorris - 27 Dec 2005, 28 Mar 2010

Topic revision: r1 - 28 Mar 2010 - 03:43:46 - WikiGuest?
This site is powered by FoswikiCopyright & by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding CTSPedia? Send feedback