• This web contains the official documentation of the TWiki Release 01-Dec-2001, code named AthensRelease. It is a read-only web for reference.
• This release is deprecated, see TWiki-6.1 for the latest release.
Tags:
create new tag
view all tags

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 TWiki This is a real FAQ, and also a demo of an easily implemented knowledge base solution. To see how it`s done, view the source...
  • TWiki.TWikiFaqTemplate: FAQ: Answer: Back to: TWikiFAQ Contributors:
  • TWiki.TextFormattingFAQ: Text Formatting FAQ This topics lists frequently asked questions on text formatting. Text formatting applies to people who edit TWiki pages in raw edit mode . TextFormattingRules...

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 can I create a simple TWiki Forms based application? Answer...
  • I am a registered user and I have authenticated myself before I edited a topic. But after saving the topic, the left bar and the variable %WIKIUSERNAME% are showing "TWikiGuest" instead of my name. Answer...
  • How do I convert a table from HTML to TML? Answer...
  • How do I set up cron jobs on Mac OS X? Answer...
  • How do I delete or rename a topic? Answer...
  • How do I delete or rename a file attachment? Answer...
  • Why does the topic revision not increase when I edit a topic? Answer...
  • When I try to access TWiki, I get the "Premature end of script headers: ..." error. Answer...
  • TWiki has a GPL (GNU General Public License). What is GPL? Answer...
  • How can I create a .htpasswd file that is owned by the webserver user? Answer...
  • How do you log off? Suppose I log in with the guest username but later I want to use another username, how do I log off from the guest user name? Answer...
  • How do I move the form to the top of the page? Answer...
  • Answer...
  • Need to know which is the best stable version of perl to be used in the End. 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...
  • How can I use international (I18N) characters in usernames? Answer...
  • What does the "T" in TWiki stand for? 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 revision: r1 - 2001-11-23 - MikeMannix
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.