+## <a name="TWiki Variables"></a> TWiki Variables
+
+### <a name="Predefined Variables"></a> Predefined Variables
+
%WIKITOOLNAME% expands the following variables enclosed in % percent signs:
<table border="1">
<td> The path of the attachment URL of the current topic, is <b>http://www.dementia.org/twiki//view</b></td>
</tr>
<tr>
+ <td><code>%URLPARAM{"name"}%</code></td>
+ <td> Returns the value of a URL parameter. I.e. <code>%URLPARAM{"skin"}%</code> returns <b>print</b> for a <code>.../view/%WEB%/%TOPIC%?skin=print</code> URL. Is <b></b></td>
+ </tr>
+ <tr>
<td><code>%WIKITOOLNAME%</code></td>
<td> Name of wiki tool, is <b>%WIKITOOLNAME%</b></td>
</tr>
</tr>
<tr>
<td><code>%GMTIME%</code></td>
- <td> GM time, is <b>29 Jun 2010 - 15:25</b></td>
+ <td> GM time, is <b>29 Jun 2010 - 15:26</b></td>
</tr>
<tr>
<td><code>%GMTIME{"format"}%</code></td>
<td> 2 digit year </td>
<td> 99 </td>
</tr>
- </table> Variables can be shortened to 3 characters. Example: <br /><code>%GMTIME{"$day $month, $year - $hour:$min:$sec"}%</code> is <br /><b>29 Jun, 2010 - 15:25:46</b></td>
+ </table> Variables can be shortened to 3 characters. Example: <br /><code>%GMTIME{"$day $month, $year - $hour:$min:$sec"}%</code> is <br /><b>29 Jun, 2010 - 15:26:30</b></td>
</tr>
<tr>
<td><code>%SERVERTIME%</code></td>
- <td> Server time, is <b>29 Jun 2010 - 11:25</b></td>
+ <td> Server time, is <b>29 Jun 2010 - 11:26</b></td>
</tr>
<tr>
<td><code>%SERVERTIME{"format"}%</code></td>
- <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:25</b></td>
+ <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:26</b></td>
</tr>
<tr>
<td><code>%HTTP_HOST%</code></td>
<td> If present in included topic, stop to include text at this location and ignore the remaining text. A normal view of the topic shows everyting exept the <code>%STOPINCLUDE%</code> variable itself. </td>
</tr>
<tr>
+ <td><code>%TOC%</code></td>
+ <td> Table of Content of current topic. </td>
+ </tr>
+ <tr>
+ <td><code>%TOC{"SomeTopic" ...}%</code></td>
+ <td> Table of Content. Shows a TOC that is generated automatically based on headings of a topic. Headings in [[Main/WikiSyntax]] (<code>"---++ text"</code>) and HTML (<code>"<h2>text<h2>"</code>) are taken into account. Parameter is composed of the topic name, followed by optional <code>name="value"</code> pairs: <table border="1" cellpadding="0" cellspacing="0">
+ <tr>
+ <th bgcolor="#99CCCC"><strong> Pair: </strong></th>
+ <th bgcolor="#99CCCC"><strong> Description: </strong></th>
+ <th bgcolor="#99CCCC"><strong> Default: </strong></th>
+ </tr>
+ <tr>
+ <td><code>web="Name"</code></td>
+ <td> Name of web </td>
+ <td> Current web </td>
+ </tr>
+ <tr>
+ <td><code>depth="2"</code></td>
+ <td> Limit depth of headings shown in TOC </td>
+ <td> 6 </td>
+ </tr>
+ </table> Examples: <code><b>%TOC{depth="2"}%</b></code>, <code><b>%TOC{"TWikiDocumentation" web="TWiki"}%</b></code></td>
+ </tr>
+ <tr>
<td><code>%SEARCH{"str" ...}%</code></td>
- <td> Inline search, shows a search result embedded in a topic. Parameter is composed of the search string, followed by optional <code>name="value"</code> pairs: <table border="1" cellpadding="0" cellspacing="0">
+ <td> Inline search, shows a search result embedded in a topic. Parameter is composed of the search term (enclosed in double quotes), followed by optional <code>name="value"</code> pairs: [1] <table border="1" cellpadding="0" cellspacing="0">
<tr>
<th bgcolor="#99CCCC"><strong> Pair: </strong></th>
<th bgcolor="#99CCCC"><strong> Description: </strong></th>
<th bgcolor="#99CCCC"><strong> Default: </strong></th>
</tr>
<tr>
+ <td><code>search="food"</code></td>
+ <td> Search term, (either regex or literal, depending on the <code>regex</code> parameter) </td>
+ <td> (used if initial search term is missing) </td>
+ </tr>
+ <tr>
<td><code>web="Name"</code><br /><code>web="Main Know"</code><br /><code>web="all"</code></td>
- <td> Wiki web to search: A web, a list of webs separated by whitespace, or all webs <code>[1]</code></td>
+ <td> Wiki web to search: A web, a list of webs separated by whitespace, or all webs <code>[2]</code></td>
<td> Current web </td>
</tr>
<tr>
</tr>
<tr>
<td><code>%VAR{"NAME" web="Web"}%</code></td>
- <td> Get a preference value from another web then the current one. Example: To get <code>%WEBBGCOLOR%</code> of the Main web write <code>%VAR{"WEBBGCOLOR" web="Main"}%</code>, is <code><b></b></code></td>
+ <td> Get a preference value from a web other then the current one. Example: To get <code>%WEBBGCOLOR%</code> of the Main web write <code>%VAR{"WEBBGCOLOR" web="Main"}%</code>, is <code><b></b></code></td>
<td>
<p>
</p>
</tr>
</table>
-[1] **_Note_**: A web can be excluded from a `web="all"` search if you define a `NOSEARCHALL=on` variable in its [[WebPreferences]].
+[1] **_Note_**: The search form uses identical names for input fields.
+
+[2] **_Note_**: A web can be excluded from a `web="all"` search if you define a `NOSEARCHALL=on` variable in its [[WebPreferences]].
+
+### <a name="Preferences Variables"></a> 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):
- Additional preferences variables can be defined on all three level as needed. Example:
- `Set MYLOGO = %PUBURLPATH%/%MAINWEB%/LogoTopic/logo.gif`
--- [[PeterThoeny]] - 19 Jan 2001 <br />
+-- [[PeterThoeny]] - 24 Mar 2001 <br />