none
[openafs-wiki.git] / TWiki / TWikiVariables.mdwn
index d07d27b..b0a70c6 100644 (file)
 
 # <a name="TWiki Variables"></a> 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_
 
 ## <a name="Overview"></a> Overview
 
-TWikiVariables are text strings enclosed in percentage signs: <code>**%VARIABLE%**</code> 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.
 
 ## <a name="Predefined Variables"></a> 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.
 
-%WIKITOOLNAME% expands the following variables enclosed in % percent signs:
+%WIKITOOLNAME% expands the following variables (enclosed in <code>**%**</code> percent signs):
 
-<table align="center" border="1" cellpadding="2" cellspacing="0" style="background-color: #fafafa" width="90%"><font size="13px"><font face="sans-serif"><tr>
+<table align="center" border="1" cellpadding="2" cellspacing="0" style="background-color: #f5f5f5" width="90%"><font size="13px"><font face="sans-serif"><tr>
         <th width="160"> Variable: </th>
         <th> Expanded to: </th>
       </tr>
@@ -118,6 +118,10 @@ With a couple of notable exceptions, predefined variables return set values that
         <td> The index topic of all registered users. Is <b>TWikiUsers</b></td>
       </tr>
       <tr>
+        <td><code>%WIKIPREFSTOPIC%</code></td>
+        <td> The web preferences topic. Is <b>TWikiPreferences</b></td>
+      </tr>
+      <tr>
         <td><code>%WEBPREFSTOPIC%</code></td>
         <td> The web preferences topic. Is <b>WebPreferences</b></td>
       </tr>
@@ -213,7 +217,7 @@ With a couple of notable exceptions, predefined variables return set values that
       </tr>
       <tr>
         <td><code>%GMTIME%</code></td>
-        <td> GM time, is <b>29 Jun 2010 - 15:30</b></td>
+        <td> GM time, is <b>29 Jun 2010 - 15:31</b></td>
       </tr>
       <tr>
         <td><code>%GMTIME{"format"}%</code></td>
@@ -263,15 +267,15 @@ With a couple of notable exceptions, predefined variables return set values that
               <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:30:25</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:31:15</b></td>
       </tr>
       <tr>
         <td><code>%SERVERTIME%</code></td>
-        <td> Server time, is <b>29 Jun 2010 - 11:30</b></td>
+        <td> Server time, is <b>29 Jun 2010 - 11:31</b></td>
       </tr>
       <tr>
         <td><code>%SERVERTIME{"format"}%</code></td>
-        <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:30</b></td>
+        <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:31</b></td>
       </tr>
       <tr>
         <td><code>%HTTP_HOST%</code></td>
@@ -399,13 +403,23 @@ With a couple of notable exceptions, predefined variables return set values that
             </tr>
             <tr>
               <td><code>nosummary="on"</code></td>
-              <td> Show topic title only </td>
+              <td> Show topic title only. [3] </td>
               <td> Show topic summary </td>
             </tr>
             <tr>
               <td><code>bookview="on"</code></td>
-              <td>[[Main/BookView]] search, e.g. show complete topic text </td>
-              <td> Show topic summary </td>
+              <td>[[Main/BookView]] search, e.g. show complete topic text. [3] </td>
+              <td> Show topic summary. </td>
+            </tr>
+            <tr>
+              <td><code>format="..."</code></td>
+              <td> Define a [[Main/FormattedSearch]], i.e. <br /><code>"   * [[$topic]]: $summary"</code>. [3] </td>
+              <td> Show regular search result with topic summary </td>
+            </tr>
+            <tr>
+              <td><code>header="..."</code></td>
+              <td> Specify header of [[Main/FormattedSearch]], i.e. <br /><code>"   * *Topic: Summary:*"</code>. </td>
+              <td> Show regular header </td>
             </tr>
             <tr>
               <td><code>nosearch="on"</code></td>
@@ -466,12 +480,14 @@ With a couple of notable exceptions, predefined variables return set values that
 > : 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]].
+>
+> [3] **_Note_**: Regular search, no summary, [[BookView]] and [[FormattedSearch]] are exclusive.
 
 ## <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):
 
-<table align="center" border="1" cellpadding="2" cellspacing="0" style="background-color: #fafafa" width="90%"><font size="13px"><font face="sans-serif"><tr>
+<table align="center" border="1" cellpadding="2" cellspacing="0" style="background-color: #f5f5f5" width="90%"><font size="13px"><font face="sans-serif"><tr>
         <th width="160"> Variable: </th>
         <th> Level: </th>
         <th> What: </th>