X-Git-Url: https://git.openafs.org/?p=openafs-wiki.git;a=blobdiff_plain;f=TWiki%2FTWikiVariables.mdwn;h=7a1216bf894349a3b2100e37dff56afead950c5c;hp=b0e6bed4aaab554d191056e587ab6f0ba678544e;hb=04be9bae478dd860b91bd383ac1d838e0ea91e95;hpb=98e5b82a176f1746b9e91e8117e9a30383ef9ef9 diff --git a/TWiki/TWikiVariables.mdwn b/TWiki/TWikiVariables.mdwn index b0e6bed..7a1216b 100644 --- a/TWiki/TWikiVariables.mdwn +++ b/TWiki/TWikiVariables.mdwn @@ -1,6 +1,7 @@
-## TWiki Variables +# TWiki Variables + +_Text strings expanded on the fly include predefined, preference-driven and custom-defined data_ + +## Overview TWikiVariables are text strings enclosed in percentage signs: **%VARIABLE%** that represent stored data. When a topic is rendered for viewing, defined variables are replaced by their actual values. TWiki has two types of variable, predefined and Preference-based, where usually you determine the content. Through Preference variables, you can also define custom variables, creating new variable name and value. TWiki variables are as simple to use as they are powerful, and vice versa! -### Predefined Variables +## Predefined Variables With a couple of notable exceptions, predefined variables return set values that are defined one-time on installation and left alone. Most are directory names and file paths, customized for your server, and only have to be updated once in the main configuration file if your server set-up changes. @@ -257,7 +262,7 @@ With a couple of notable exceptions, predefined variables return set values that 2 digit year 99 - Variables can be shortened to 3 characters. Example:
%GMTIME{"$day $month, $year - $hour:$min:$sec"}% is
29 Jun, 2010 - 15:29:26 + Variables can be shortened to 3 characters. Example:
%GMTIME{"$day $month, $year - $hour:$min:$sec"}% is
29 Jun, 2010 - 15:29:33 %SERVERTIME% @@ -431,7 +436,7 @@ With a couple of notable exceptions, predefined variables return set values that > > [2] **_Note_**: A web can be excluded from a `web="all"` search if you define a `NOSEARCHALL=on` variable in its [[WebPreferences]]. -### Preferences Variables +## Preferences Variables Additional variables are defined in the preferences ( site-level ( **_SL_** ) in [[TWikiPreferences]], web-level ( **_WL_** ) in [[WebPreferences]] of each web, and user level ( **_UL_** ) preferences in individual user topics): @@ -570,12 +575,12 @@ Additional variables are defined in the preferences ( site-level ( **_SL_** ) in List of preferences that are not allowed to be overridden by next level preferences -### Setting Preferences +## Setting 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** -### Creating Custom Variables +## 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.