|
TWiki Variables
About Variables |
|
< < | 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 |
| The path of the script URL of The Caboteria, is /wiki/bin |
%SCRIPTSUFFIX% | |
|
< < | The script suffix, i.e. .pl , is | |
> > | The script suffix, ex: .pl , .cgi is | |
|
%PUBURL% |
The public URL of TWiki, is http://caboteria.org/wiki/pub |
|
| The path of the attachment URL of the current topic, is /wiki/pub/TWiki/TWikiVariables |
%URLPARAM{"name"}% | |
|
< < | 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 The Caboteria |
%WIKIVERSION% |
|
|
< < | Wiki tool version, is TWiki-5.1.4, Sat, 16 Feb 2013, build 25114 | |
> > | Wiki tool version is TWiki-5.1.4, Sat, 16 Feb 2013, build 25114 | |
| |
|
< < | 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 |
|
| |
|
< < | The web containing all documentation and configuration of The Caboteria. Is TWiki | |
> > | The web containing all documentation and configuration of The Caboteria 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. |
|
| SL , WL |
List of preferences that are not allowed to be overridden by next level preferences |
|
|
< < |
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:
|
|
< < |
- 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
|
|
< < | -- MikeMannix - 26 Aug 2001 |
> > | -- MikeMannix - 30 Aug 2001 |