netfrag.org . TWiki . TWikiVariablesExamples

TWikiVariables Examples

Bullet list showing topic name and summary

Write this:

%SEARCH{ "FAQ" scope="topic" web="TWiki" nosearch="on" nototal="on" header="   * *Topic: Summary:*" format="   * [[$web.$topic]]: $summary" }%

To get this:

Table with form field values of topics with a form

Write this:

| *Topic:* | *OperatingSystem:* | *OsVersion:* |
%SEARCH{ "[T]opicClassification.*?value=\"[P]ublicFAQ\"" scope="text" regex="on" nosearch="on" nototal="on" format="| [[$topic]] | $formfield(OperatingSystem?) | $formfield(OsVersion?) |" }%

To get this: (simulated)

Topic: OperatingSystem: OsVersion:
IncorrectDllVersionW32PTH10DLL OsWin 95/98
WinDoze95Crash OsWin 95

Extract text from a topic using regular expressions

Write this:

%SEARCH{ "__Back to\:__ TWikiFAQ" scope="text" web="TWiki" regex="on" nosearch="on" nototal="on" header="TWiki FAQs:" format="   * $pattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) [[$web.$topic][Answer...]]" }%

To get this:

TWiki FAQs:

Creating Custom Variables

Example: Create a custom logo variable

-- MikeMannix? - 23 Nov 2001

----- Revision r1.1 - 23 Nov 2001 - 11:33 - MikeMannix?