|
META TOPICPARENT |
name="WebHome" |
|
|
< < |
Warning: Can't find topic TWiki.UtilTempDocNote
|
|
TWiki Variables |
|
< < | Text strings expanded on the fly include predefined, preference-driven and custom-defined data |
> > | Text strings expanded on the fly to display data or system info |
|
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! |
> > | TWikiVariables are text strings - %VARIABLE% - that expand into content whenever a page is opened. Variables are replaced by their actual values: stored data, or system info (like the date, or the current user). There are predefined variables, and Preference variables that you set. You can also define custom variables, with new names and values. |
|
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. |
> > | With a couple of notable exceptions, predefined variables return set values that are defined 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. |
| |
|
< < | TWiki expands the following variables enclosed in % percent signs: |
> > | TWiki expands the following variables (enclosed in % percent signs): |
| |
|
< < | |
> > | |
| |
| %WIKIUSERSTOPIC% |
The index topic of all registered users. Is TWikiUsers |
|
|
|
> > | %WIKIPREFSTOPIC% |
The web preferences topic. Is TWikiPreferences |
|
|
| %WEBPREFSTOPIC% |
The web preferences topic. Is WebPreferences |
|
|
|
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): |
|
< < | |
> > | |
| |
|
- 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: Create a custom logo variable
- To place a logo anywhere in a web by typing
%MYLOGO% , simply define the variable on the web's WebPreferences page. You also have to upload logo.gif - this can be done by attaching a file to LogoTopic (any topic name you choose):
-
Set MYLOGO = %PUBURL%/%MAINWEB%/LogoTopic/logo.gif
|