r2 - 14 Nov 2002 - 13:16:00 - NicholasWaltonYou are here: TWiki >  Support Web  > TWikiPlugins
%SECTION0% Plugins

%SECTION1% Introduction to Plugins

TWikiPlugins add functionality to the core TWiki code. A number of the more interesting plugins are available on this AgWiki. They should all be listed in the TextFormattingRules page, with links to the plugin's own help page.

%SECTION1% The Calendar plugin

The CalendarPlugin interprets markup like this:

%CALENDAR{month="11" year="2002"}%

and renders it like this:

November 2002
          01 02
03 04 05 06 07 08 09
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Additionally, if the page contains a list like this:

  • 21 Dec - The Winter Sunstead
  • 24 Dec - Remember to hang out stockings
  • 25 Dec - Xmas day!

then any calendar of that month will include the listed items. (The list can be anywhere in the document. It can be placed in a comment so that the list is not itself rendered. The format of list entries must be exactly as shown, including the hyphens.)

%CALENDAR{month="12" year="2002" showweekdayheaders="1"}%

December 2002
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
01 02 03 04 05 06 07
08 09 10 11 12 13 14
15 16 17 18 19 20 21
The Winter Sunstead
22 23 24
Remember to hang out stockings
25
Xmas day!
26 27 28
29 30 31        

%SECTION2% Caveat (bug!)

Calendars are not correctly rendered during previewing. Specifically, days which should be highlighted are not.

%SECTION1% The Chart plugin

Consider the following table.

Monday 5
Tuesday 3
Wednesday 7
Thursday 0
Friday 2

Wouldn't it look good as a graph? With the ChartPlugin? it's no easier said than done.

%CHART{ type="line" name="gday" table="gday" data="R1:C2..R5:C2" xaxis="R1:C1..R5:C1" yaxis="on" }%

%CHART{ type="line" name="gday" table="gday" data="R1:C2..R5:C2" xaxis="R1:C1..R5:C1" yaxis="on" }%

%SECTION1% The Interwiki plugin

The InterwikiPlugin permits easy references to other TWiki sites, as defined in the InterWikis page. For example, Avo:Avo/ContactSheet renders as Avo:Avo/ContactSheet, and links to the specified page on the AVO TWiki.

%SECTION1% The Smilies plugin

The SmiliesPlugin is everybody's favourite. smile

With this plugin, :-) is rendered as smile provided there are no other characters abutting the smilie. See the SmiliesPlugin page for the other ludicrous smilies that are available.

Fortunately, I use a Gecko-based browser (currently Phoenix, but sometimes Galeon or even Mozilla itself) with images set to animate once. So feel free to use the animated smilies: I won't come after you. (Coming soon: flashing text!)

%SECTION1% The Table plugin

The TablePlugin affords extra control over tables. For example, here's a plain TWiki table.

User Favourite colour Favourite drink
Tim Goodwin Red Coffee (black)
Tony Linde White Coffee (white)
Patricio Ortiz Blue Tea

Now here's the same table prefixed by

%TABLE{ sort="on" databg="#FCC" tableborder="0" cellpadding="5" }%

Notice that, as well as the cosmetic changes, each column heading can now be clicked to sort the table by that column (click again to reverse the sort).

User Favourite colour Favourite drink
Tim Goodwin Red Coffee (black)
Tony Linde White Coffee (white)
Patricio Ortiz Blue Tea

%SECTION1% The Toc plugin

The TocPlugin (Table of Contents) was responsible for generating the section numbers on this page. For example,

%SECTION2% Example of generated section number

renders like this.

%SECTION2% Example of generated section number

The 2 in SECTION2 indicates that this is a second-level heading (which has a three part number... go figure).

And having done all that, creating a Contents table for the page is as easy as

%CONTENTS%

%CONTENTS%

This plugin can do other clever things too: see TocPluginHelp for a full description.

-- TimGoodwin - 13 Nov 2002

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
AstroGrid Service Click here for the
AstroGrid Service Web
This is the AstroGrid
Development Wiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback