TWiki Home Tharsis . TWiki . TWikiVariablesExamples (r1.1 vs. r1.2) Tharsis webs:
Design | Guilds | Combat | Website
TWiki . { Home | Welcome | Register | Changes | Index | Search | Go }
 <<O>>  Difference Topic TWikiVariablesExamples (r1.2 - 07 Jan 2003 - FantoM)

-- MikeMannix - 23 Nov 2001


-- MikeMannix - 23 Nov 2001

 <<O>>  Difference Topic TWikiVariablesExamples (r1.1 - 23 Nov 2001 - MikeMannix)

%META:TOPICINFO{author="MikeMannix" date="1006515213" format="1.0" version="1.1"}%

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:

  • Topic: Summary:
  • TWiki.TWikiFAQ: Frequently Asked Questions About Tharsis This is a real FAQ, and also a demo of one easily implemented knowledge base solution. See how it's done, click Edit . SEARCH ...
  • TWiki.TWikiFaqTemplate: FAQ: Answer: Back to: NOP TWikiFAQ WIKIUSERNAME DATE
  • TWiki.TextFormattingFAQ: Text Formatting FAQ The most frequently asked questions about text formatting are answered. Also, TextFormattingRules contains the complete TWiki shorthand system ...

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:

  • How do I delete or rename a topic? Answer...
  • Why does the topic revision not increase when I edit a topic? Answer...
  • TWiki has a GPL (GNU General Public License). What is GPL? Answer...
  • I've problems with the WebSearch. There is no Search Result on any inquiry. By clicking the Index topic it's the same problem. Answer...
  • What happens if two of us try to edit the same topic simultaneously? Answer...
  • I would like to install TWiki on my server. Can I get the source? Answer...
  • So what is this WikiWiki thing exactly? Answer...
  • Everybody can edit any page, this is scary. Doesn't that lead to chaos? Answer...

Creating Custom Variables

  • You can add your own preference variables for an entire site, a single web, or a single topic, using the standard syntax. Whatever you include in your variable will be expanded on display, and treated exactly as if it had been written out. So you can place formatted text, page links, image paths.

Example: Create a custom logo variable
  • To place a logo anywhere in a web by typing %MYLOGO%, simply define the variable on the web's WebPreferences page. You also have to upload logo.gif - this can be done by attaching a file to LogoTopic (any topic name you choose):
    • Set MYLOGO = %PUBURL%/%MAINWEB%/LogoTopic/logo.gif

-- MikeMannix - 23 Nov 2001

Topic TWikiVariablesExamples . { View | Diffs | r1.2 | > | r1.1 | More }
Revision r1.1 - 23 Nov 2001 - 11:33 GMT - MikeMannix
Revision r1.2 - 07 Jan 2003 - 00:36 GMT - FantoM
Copyright © 2001 by the contributing authors. All material on this collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding Tharsis? Send feedback.