Difference: TWikiVariables (34 vs. 35)

Revision 3530 Aug 2001 - MikeMannix

Line: 1 to 1
 

TWiki Variables

About Variables

Changed:
<
<
Include/write if not found elsewhere.
>
>
TWikiVariables are text strings enclosed in percentage signs: %VARIABLE% that represent stored data. When a topic is rendered for viewing, defined variables replaced by their actual values. TWiki has two types of variable, predefined, and Preference-based, where you can change settings. Through Preference variables, you can even define custom variables. Clearly, they are a power TWiki feature.
 

Predefined Variables

Line: 24 to 24
 
The path of the script URL of TWiki, is /twiki/bin
%SCRIPTSUFFIX%
Changed:
<
<
The script suffix, i.e. .pl, is
>
>
The script suffix, ex: .pl, .cgi is
 
%PUBURL% The public URL of TWiki, is http://www.twiki.ufba.br/twiki/pub
Line: 39 to 39
 
The path of the attachment URL of the current topic, is /twiki/pub/TWiki/TWikiVariables
%URLPARAM{"name"}%
Changed:
<
<
Returns the value of a URL parameter. I.e. %URLPARAM{"skin"}% returns print for a .../view/TWiki/TWikiVariables?skin=print URL. Is
>
>
Returns the value of a URL parameter. Ex: %URLPARAM{"skin"}% returns print for a .../view/TWiki/TWikiVariables?skin=print URL. Is
 
%WIKITOOLNAME% Name of wiki tool, is TWiki
%WIKIVERSION%
Changed:
<
<
Wiki tool version, is TWiki-4.2.2, Wed, 06 Aug 2008, build 17396
>
>
Wiki tool version is TWiki-4.2.2, Wed, 06 Aug 2008, build 17396
 
%USERNAME%
Changed:
<
<
Your login username, is guest
>
>
Your login username is guest
 
%WIKINAME% Your Wiki username. Same as %USERNAME% if not defined in the TWikiUsers topic. Is TWikiGuest
Line: 60 to 60
 
The Main web containing TWikiUsers, OfficeLocations and TWikiGroups. Is Main
%TWIKIWEB%
Changed:
<
<
The web containing all documentation and configuration of TWiki. Is TWiki
>
>
The web containing all documentation and configuration of TWiki is TWiki
 
%WEB%
Changed:
<
<
The current web, is TWiki
>
>
The current web is TWiki
 
%BASEWEB% The web name where the includes started, e.g. the web of the first topic of nested includes. Same as %WEB% in case there is no include.
Line: 320 to 320
 
SL , WL List of preferences that are not allowed to be overridden by next level preferences
Changed:
<
<

Setting and Creating New Preferences

>
>

Setting Variable Preferences

 
  • The syntax for Preferences variables is the same anywhere in TWiki. In Edit mode, from the start of a new line:
    [6 spaces] * [space] Set [space] VARIABLENAME [space] = [value]
    Example:
    • Set VARIABLENAME = value
Changed:
<
<
  • 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, images.
    Example: To place a logo anywhere in a web by typing %MYLOGO%, define the variable in the web's WebPreferences topic, like this (in this case, you also have to upload logo.gif to the same directory):
>
>

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: To place a logo anywhere in a web by typing %MYLOGO%, define the variable in the web's WebPreferences topic, like this (in this case, you also have to upload logo.gif to the same directory):
 
    • Set MYLOGO = %PUBURLPATH%/%MAINWEB%/LogoTopic/logo.gif
Changed:
<
<
-- MikeMannix? - 26 Aug 2001
>
>
-- MikeMannix? - 30 Aug 2001
 
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
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.TWikiVariables