Tags:
create new tag
view all tags
ALERT! NOTE: This is a DistributionDocument.
  • Please help maintain high quality documentation: This is a wiki, please fix the documentation if you find errors or incomplete content.
  • Put questions and suggestions concerning the documentation of this topic in the comments section below.
  • Use the Support web for problems you are having using TWiki.
  • Use the Sandbox web to evaluate & test TWiki.

TWiki Variables Quickstart

TWiki Variables are names enclosed in percent signs that are that are expanded to some other text when the topic is displayed. For example, %TOPIC% is expanded to TWikiVariablesQuickStart. Some variables can take arguments in curly braces - for example, %INCLUDE{"OtherTopic" arg="value"}%.

Many TWiki variables are built-in, and others are predefined for your convenience. TWikiVariables describes how you can also define your own TWiki Variables at the entire site, individual web, or individual topic level. Variables are fully expanded before any of the TWiki text formatting rules are applied.

Commonly used variables:

  • %TOC% : Automatically generates a table of contents based on headings in a topic - see the top of this page for an example.
  • %WEB% : The current web, is TWiki.
  • %TOPIC% : The current topic name, is TWikiVariablesQuickStart.
  • %ATTACHURL% : The attachment URL of the current topic. Example usage: If you attach a file to a topic you can refer to it as %ATTACHURL%/image.gif to show the URL of the file or the image in your text.
  • %INCLUDE{"SomeTopic"}% : Server side include, includes another topic. The current web is the default web. Example: %INCLUDE{"TWiki06x01.SiteMap"}%
  • %SEARCH{"sushi"}% : Inline search showing the search result embedded in a topic. FormattedSearch gives you control over formatting, used to create web-based applications.
  • Documentation Graphics: There are many graphics available to use in your topics. Use %ICON{"help"}%, %ICON{"tip"}%, and %ICON{"warning"}% to get: HELP, TIP, and ALERT!, respectively.
  • Use the TWiki Variables Wizard to find and compose variables.
  • See all TWiki Variables.

Tip, idea To "escape" a variable, prefix it with an exclamation mark. Write: !%SOMEVARIABLE% to get: %SOMEVARIABLE%.

Related Topics: UserDocumentationCategory, TWikiVariables, TWikiVariablesWizard, TWikiVariablesSearch, TextFormattingRules



Comments & Questions about this Distribution Document Topic

Please correct typos

%ICON{"tip"}%           ('|' --> '}')
%ICON{"warning"}%       (icon uppercase)

-- MartinSpohn - 03 Jan 2007

Thanks Martin, svn is updated.

-- PeterThoeny - 03 Jan 2007

Using a prefix of ! to "escape" a variable does not work for %AQUA% or other colors in 6.0.1 For example, in TWiki markup * %AQUA%Ready%ENDCOLOR% (!%AQUA%)- ready to be worked on; displays as Ready (!)- ready to be worked on; with only the preceding dot, left paren, and Exclamation point in black, the rest in aqua.

-- David Tremain - 2018-01-24

David: It looks like ! requires a whitespace prefix. If you want to use parenthesis you can use <nop> instead of the exclamation point.

-- Peter Thoeny - 2018-01-25

Please use the Support forum if you have questions about TWiki features. This comment section is about the documentation of this topic.
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2018-01-25 - PeterThoeny
 
  • 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-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.