Difference: TWikiVariables (82 vs. 83)

Revision 832007-03-06 - TWikiContributor

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Deleted:
<
<
 
Changed:
<
<

TWiki Variables

>
>

TWiki Variables

  Special text strings expand on the fly to display user data or system info
Line: 10 to 9
 
  1. Preferences variables: Can be defined and changed by the user
  2. Predefined variables: Defined by the TWiki system or by Plugins (for example, the SpreadSheetPlugin introduces a %CALC{}% variable)
Added:
>
>
 

Using Variables

To use a variable type its name. For example,

Line: 35 to 36
 

Setting Preferences Variables

You can set variables in all the following places:
Changed:
<
<
  1. local site level in TWiki.TWikiPreferences
>
>
  1. local site level in TWiki.TWikiPreferences
 
  1. plugin topics (see TWikiPlugins)
  2. local site level in Main.TWikiPreferences
Changed:
<
<
  1. user level in individual user topics in Main web
>
>
  1. user level in individual user topics in Main web
 
  1. web level in WebPreferences of each web
  2. topic level in topics in webs
  3. session variables (if sessions are enabled)

Settings at higher-numbered levels override settings of the same variable at lower numbered levels, unless the variable was included in the setting of FINALPREFERENCES at a lower-numbered level, in which case it is locked at the value it has at that level.

Added:
>
>
If you are setting a variable and using it in the same topic, note that TWiki reads all the variable settings from the saved version of the topic before it displays anything. This means you can use a variable anywhere in the topic, even if you set it somewhere inconspicuous near the end. But beware: it also means that if you change the setting of a variable you are using in the same topic, Preview will show the wrong thing, and you must Save the topic to see it correctly.
 The syntax for setting Variables is the same anywhere in TWiki (on its own TWiki bullet line, including nested bullets):
[multiple of 3 spaces] * [space] Set [space] VARIABLENAME [space] = [space] value
Examples:
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2024 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.