none
[openafs-wiki.git] / TWiki / TWikiVariablesQuickStart.mdwn
1 ## <a name="TWiki Variables Quickstart"></a> TWiki Variables Quickstart
2
3 TWiki Variables are names that are enclosed in percent signs `%` that are expanded on the fly. Some variables take arguments, such as `%INCLUDE%`. For those variables, the arguments are included in curly braces (\{ and \}).
4
5 <table border="1" cellpadding="0" cellspacing="0">
6   <tr>
7     <th bgcolor="#99CCCC"><strong> Variable </strong></th>
8     <th bgcolor="#99CCCC"><strong> In brief </strong></th>
9     <th bgcolor="#99CCCC"><strong> Full documentation </strong></th>
10   </tr>
11   <tr>
12     <td><code>%TOC%</code></td>
13     <td> Automatically generates a table of contents based on headings in a topic - see the top of this page for an example. </td>
14     <td>[[Main/VarTOC]]</td>
15   </tr>
16   <tr>
17     <td><code>%WEB%</code></td>
18     <td> The current web, is <b>%WEB%</b>. </td>
19     <td>[[Main/VarWEB]]</td>
20   </tr>
21   <tr>
22     <td><code>%TOPIC%</code></td>
23     <td> The current topic name, is <b>WebHome</b>. </td>
24     <td>[[Main/VarTOPIC]]</td>
25   </tr>
26   <tr>
27     <td><code>%ATTACHURL%</code></td>
28     <td> The attachment URL of the current topic. Example usage: If you attach a file to a topic you can refer to it as <code><b>%ATTACHURL%/image.gif</b></code> to show the URL of the file or the image in your text. </td>
29     <td>[[Main/VarATTACHURL]]</td>
30   </tr>
31   <tr>
32     <td><code>%INCLUDE{"SomeTopic"}%</code></td>
33     <td> Server side include, includes another topic. The current web is the default web. Example: <code><b>%INCLUDE{"TWiki.SiteMap"}%</b></code></td>
34     <td>[[Main/VarINCLUDE]]</td>
35   </tr>
36   <tr>
37     <td><code>%SEARCH{"sushi"}%</code></td>
38     <td> Inline search showing the search result embedded in a topic. [[Main/FormattedSearch]] gives you control over formatting, useful for creating web-based applications. </td>
39     <td>[[Main/VarSEARCH]]</td>
40   </tr>
41 </table>
42
43 [[TWikiPreferences]] defines some site-wide variables. Among them are:
44
45 - **Line break:** Write `%BR%` to start a new line.
46 - **Colored text:** Write: `%RED% Red %ENDCOLOR% and %BLUE% blue %ENDCOLOR% colors` to get: %RED% Red %ENDCOLOR% and %BLUE% blue %ENDCOLOR% colors.
47
48 There are many more variables. To see them all, go to **[[TWikiVariables]]**.
49
50 **Documentation Graphics:** There are many graphics available to use in your topics. Use `%ICON{"help"}%`, `%ICON{"tip"}%`, and `%ICON{"warning"}%` to get: %H%, %T%, and %X%, respectively. [[TWikiDocGraphics]] lists them all.
51
52 <img src="http://www.dementia.org/twiki//view/Main/WebHome/tip.gif" width="16" height="16" alt="tip" /> To "escape" a variable, prefix it with an exclamation mark. Write: `!%SOMEVARIABLE%` to get: %SOMEVARIABLE%.