none
[openafs-wiki.git] / TWiki / TWikiVariables.mdwn
index 44383bc..1793c92 100644 (file)
@@ -1,7 +1,6 @@
 <div>
   <ul>
     <li><a href="#TWiki Variables"> TWiki Variables</a><ul>
-        <li><a href="#Overview"> Overview</a></li>
         <li><a href="#Predefined Variables"> Predefined Variables</a></li>
         <li><a href="#Preferences Variables"> Preferences Variables</a></li>
         <li><a href="#Setting Preferences"> Setting Preferences</a></li>
 
 # <a name="TWiki Variables"></a> TWiki Variables
 
-_Text strings expanded on the fly to display data or system info_
+_Special text strings expand on the fly to display user data or system info_
 
-## <a name="Overview"></a> Overview
-
-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.
+TWikiVariables are text strings - `%VARIABLE%` - that expand into content whenever a page is opened. When a topic is rendered for viewing, `VARIABLES` are replaced by data, either user-entered, or info automatically generated by TWiki (like the date, or the current username). There are predefined variables, and Preference variables that you configure. You can also define custom variables, with new names and values.
 
 ## <a name="Predefined Variables"></a> Predefined Variables
 
-Most predefined variables return values that were either defined when TWiki was installed, or taken from server info (like current username, or date and time). Many of the variables let you control how the formatted results appear.
+Most predefined variables return values that were either set in the <code>**lib/twiki.cfg**</code> file, when TWiki was installed, or taken from server info (like current username, or date and time). Many of the variables let you format the appearance of the display results.
+
+- %T% **Take the time to thoroughly read through ALL preference variables.** If you actively configure your site, review variables periodically. They cover a wide range of functions, and it can be easy to miss the one perfect variable for something you have in mind. For example, see <code>**%INCLUDINGTOPIC%**</code>, <code>**%INCLUDE%**</code>, and the mighty <code>**%SEARCH%**</code>.
 
-%WIKITOOLNAME% expands the following variables (enclosed in <code>**%**</code> percent signs):
+This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the following variables (enclosed in <code>**%**</code> percent signs):
 
 <table align="center" border="1" cellpadding="2" cellspacing="0" style="background-color: #f5f5f5" width="90%">
   <tr>
@@ -68,15 +67,15 @@ Most predefined variables return values that were either defined when TWiki was
   </tr>
   <tr>
     <td><code>%WIKITOOLNAME%</code></td>
-    <td> Name of wiki tool, is <b>%WIKITOOLNAME%</b></td>
+    <td> The name of your TWiki site - <b>%WIKITOOLNAME%</b></td>
   </tr>
   <tr>
     <td><code>%WIKIVERSION%</code></td>
-    <td> Wiki tool version is <b>TWiki-4.1.2, Sat, 03 Mar 2007, build 13046</b></td>
+    <td> Your current TWiki version - <b>TWiki-4.1.2, Sat, 03 Mar 2007, build 13046</b></td>
   </tr>
   <tr>
     <td><code>%USERNAME%</code></td>
-    <td> Your login username is <b>admin</b></td>
+    <td> Your login username - <b>admin</b></td>
   </tr>
   <tr>
     <td><code>%WIKINAME%</code></td>
@@ -84,15 +83,15 @@ Most predefined variables return values that were either defined when TWiki was
   </tr>
   <tr>
     <td><code>%WIKIUSERNAME%</code></td>
-    <td> Your %WIKINAME% including the Main web name. Usefull for signatures. Is <b>Main.admin</b></td>
+    <td> Your %WIKINAME% including the Main web name - always use full signatures - <b>Main.admin</b></td>
   </tr>
   <tr>
     <td><code>%MAINWEB%</code></td>
-    <td> The Main web containing [[Main/TWikiUsers]], [[Main/OfficeLocations]] and [[Main/TWikiGroups]]. Is <b>Main</b></td>
+    <td> The web containing [[Main/TWikiUsers]], [[Main/OfficeLocations]] and [[Main/TWikiGroups]] is <b>Main</b></td>
   </tr>
   <tr>
     <td><code>%TWIKIWEB%</code></td>
-    <td> The web containing all documentation and configuration of %WIKITOOLNAME% is <b>TWiki</b></td>
+    <td> The web containing all documentation and site-wide preference settings for %WIKITOOLNAME% - <b>TWiki</b></td>
   </tr>
   <tr>
     <td><code>%WEB%</code></td>
@@ -104,39 +103,39 @@ Most predefined variables return values that were either defined when TWiki was
   </tr>
   <tr>
     <td><code>%INCLUDINGWEB%</code></td>
-    <td> The web name of the topic that includes the current topic. Same as <code>%WEB%</code> in case there is no include. </td>
+    <td> The web name of the topic that includes the current topic - same as <code>%WEB%</code> if there is no INCLUDE. </td>
   </tr>
   <tr>
     <td><code>%HOMETOPIC%</code></td>
-    <td> The home topic in each web. Is <b>[[Main/WebHome]]</b></td>
+    <td> The home topic in each web - <b>[[Main/WebHome]]</b></td>
   </tr>
   <tr>
     <td><code>%NOTIFYTOPIC%</code></td>
-    <td> The notify topic in each web. Is <b>[[Main/WebNotify]]</b></td>
+    <td> The notify topic in each web - <b>[[Main/WebNotify]]</b></td>
   </tr>
   <tr>
     <td><code>%WIKIUSERSTOPIC%</code></td>
-    <td> The index topic of all registered users. Is <b>TWikiUsers</b></td>
+    <td> The index topic of all registered users - <b>TWikiUsers</b></td>
   </tr>
   <tr>
     <td><code>%WIKIPREFSTOPIC%</code></td>
-    <td> The web preferences topic. Is <b>TWikiPreferences</b></td>
+    <td> The site-wide preferences topic - <b>TWikiPreferences</b></td>
   </tr>
   <tr>
     <td><code>%WEBPREFSTOPIC%</code></td>
-    <td> The web preferences topic. Is <b>WebPreferences</b></td>
+    <td> The local web preferences topic in each web - <b>WebPreferences</b></td>
   </tr>
   <tr>
     <td><code>%STATISTICSTOPIC%</code></td>
-    <td> The web statistics topic. Is <b>WebStatistics</b></td>
+    <td> The web statistics topic <b>WebStatistics</b></td>
   </tr>
   <tr>
     <td><code>%TOPIC%</code></td>
-    <td> The current topic name, is <b>%TOPIC%</b></td>
+    <td> The current topic name - <b>%TOPIC%</b></td>
   </tr>
   <tr>
     <td><code>%BASETOPIC%</code></td>
-    <td> The name of the topic where the includes started, e.g. the first topic of nested includes. Same as <code>%TOPIC%</code> in case there is no include. </td>
+    <td> The name of the topic where a single or nested INCLUDE started - same as <code>%TOPIC%</code> if there is no INCLUDE. </td>
   </tr>
   <tr>
     <td><code>%INCLUDINGTOPIC%</code></td>
@@ -178,7 +177,7 @@ Most predefined variables return values that were either defined when TWiki was
   </tr>
   <tr>
     <td><code>%WEBLIST{"format"}%</code></td>
-    <td> Web index, e.g. list of all webs. Hidden webs are excluded, e.g. webs with a <code>NOSEARCHALL=on</code> preference variable. The <code>"format"</code> defines the format of one web item. The <code>$name</code> variable gets expanded to the name of the web, <code>$qname</code> gets expanded to double quoted name, <code>$marker</code> to <code>marker</code> where web matches <code>selection</code>. Parameters are format, separator and web: <table border="1" cellpadding="0" cellspacing="0">
+    <td> Web index, ex: list of all webs. Hidden webs are excluded, e.g. webs with a <code>NOSEARCHALL=on</code> preference variable. The <code>"format"</code> defines the format of one web item. The <code>$name</code> variable gets expanded to the name of the web, <code>$qname</code> gets expanded to double quoted name, <code>$marker</code> to <code>marker</code> where web matches <code>selection</code>. Parameters are format, separator and web: <table border="1" cellpadding="0" cellspacing="0">
         <tr>
           <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
           <th bgcolor="#99CCCC"><strong> Description: </strong></th>
@@ -218,7 +217,7 @@ Most predefined variables return values that were either defined when TWiki was
   </tr>
   <tr>
     <td><code>%GMTIME%</code></td>
-    <td> GM time, is <b>29 Jun 2010 - 15:31</b></td>
+    <td> GM time, is <b>29 Jun 2010 - 15:35</b></td>
   </tr>
   <tr>
     <td><code>%GMTIME{"format"}%</code></td>
@@ -268,15 +267,15 @@ Most predefined variables return values that were either defined when TWiki was
           <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:31:55</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:35:59</b></td>
   </tr>
   <tr>
     <td><code>%SERVERTIME%</code></td>
-    <td> Server time, is <b>29 Jun 2010 - 11:31</b></td>
+    <td> Server time, is <b>29 Jun 2010 - 11:35</b></td>
   </tr>
   <tr>
     <td><code>%SERVERTIME{"format"}%</code></td>
-    <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:31</b></td>
+    <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:35</b></td>
   </tr>
   <tr>
     <td><code>%HTTP_HOST%</code></td>
@@ -303,7 +302,7 @@ Most predefined variables return values that were either defined when TWiki was
         </tr>
         <tr>
           <td><code>"Web.Topic"</code></td>
-          <td> A topic in another web, i.e. <code>%INCLUDE{"TWiki.TWikiWebsTable"}%</code></td>
+          <td> A topic in another web, i.e. <code>%INCLUDE{"TWiki.SiteMap"}%</code></td>
         </tr>
         <tr>
           <td><code>"http://..."</code></td>
@@ -326,7 +325,7 @@ Most predefined variables return values that were either defined when TWiki was
   </tr>
   <tr>
     <td><code>%TOC{"SomeTopic" ...}%</code></td>
-    <td> Table of Contents. Shows a TOC that is generated automatically based on headings of a topic. Headings in [[Main/WikiSyntax]] (<code>"---++ text"</code>) and HTML (<code>"&lt;h2&gt;text&lt;h2&gt;"</code>) are taken into account. (But not <code>"&lt;H2&gt;text&lt;/H2&gt;"</code>, which can be used to exclude a heading from the TOC.) Parameters are topic name, web and depth: <table border="1" cellpadding="0" cellspacing="0">
+    <td> Table of Contents. Shows a TOC that is generated automatically based on headings of a topic. Headings in [[Main/WikiSyntax]] (<code>"---++ text"</code>) and HTML (<code>"&lt;h2&gt;text&lt;/h2&gt;"</code>) are taken into account. (But not <code>"&lt;H2&gt;text&lt;/H2&gt;"</code>, which can be used to exclude a heading from the TOC.) Parameters are topic name, web and depth: <table border="1" cellpadding="0" cellspacing="0">
         <tr>
           <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
           <th bgcolor="#99CCCC"><strong> Description: </strong></th>
@@ -359,7 +358,7 @@ Most predefined variables return values that were either defined when TWiki was
         </tr>
         <tr>
           <td><code>"text"</code></td>
-          <td> Search term. (Is a regular expression or literal, depending on the <code>regex</code> parameter) </td>
+          <td> Search term. (Is a regular expression or literal, depending on the <code>regex</code> parameter) [TWikiAlphaRelease - for regular expressions ";" can be used to mean <em>and</em> e.g. "search;agrep" will find all topic containing search <em>and</em> agrep ] </td>
           <td> required </td>
         </tr>
         <tr>
@@ -378,8 +377,8 @@ Most predefined variables return values that were either defined when TWiki was
           <td> Topic text (body) </td>
         </tr>
         <tr>
-          <td><code>order="topic"</code><br /><code>order="modified"</code><br /><code>order="editby"</code></td>
-          <td> Sort the results of search by the topic names, last modified time, or last editor </td>
+          <td><code>order="topic"</code><br /><code>order="modified"</code><br /><code>order="editby"</code><br /><code>order=<br /> "formfield(name)"</code></td>
+          <td> Sort the results of search by the topic names, last modified time, last editor, or named field of [[Main/TWikiForms]]</td>
           <td> Sort by topic name </td>
         </tr>
         <tr>
@@ -428,11 +427,11 @@ Most predefined variables return values that were either defined when TWiki was
           <td> Show number </td>
         </tr>
         <tr>
-          <td><code><b>format="..."</b></code></td>
-          <td> Flexible custom result formatting: see <strong>[[Main/FormattedSearch]]</strong> for usage </td>
+          <td><code><b>header="..."</b></code><br /><code><b>format="..."</b></code></td>
+          <td> Custom format results: see <strong>[[Main/FormattedSearch]]</strong> for usage, variables &amp; examples </td>
           <td> Results in table </td>
         </tr>
-      </table> Example: <code><b>%SEARCH{"wiki" web="Main" scope="topic"}%</b></code></td>
+      </table> Regular example: <code><b>%SEARCH{"wiki" web="Main" scope="topic"}%</b></code><br /> Formatted example: <code><b>%SEARCH{"FAQ" scope="topic" nosearch="on" nototal="on" header="| *Topic: * | *Summary: * |" format="| $topic | $summary |"%</b></code> <em>(displays results in a table with header - [[Main/FormattedSearch]])</em></td>
   </tr>
   <tr>
     <td><code>%METASEARCH{...}%</code></td>
@@ -444,7 +443,7 @@ Most predefined variables return values that were either defined when TWiki was
         </tr>
         <tr>
           <td><code>type="topicmoved"</code></td>
-          <td> What sort of search is required? <br /><code>"topicmoved"</code> if search for a topic that may have been moved <br /><code>"parent"</code> if searcing for topics that have a specific parent i.e. its children </td>
+          <td> What sort of search is required? <br /><code>"topicmoved"</code> if search for a topic that may have been moved <br /><code>"parent"</code> if searching for topics that have a specific parent i.e. its children </td>
           <td> required </td>
         </tr>
         <tr>
@@ -459,7 +458,7 @@ Most predefined variables return values that were either defined when TWiki was
         </tr>
         <tr>
           <td><code>title="Title"</code></td>
-          <td> Text the is pre-pended to any search results </td>
+          <td> Text that is prepended to any search results </td>
           <td> required </td>
         </tr>
       </table> Example: <code><b>%METASEARCH{type="topicmoved" web="%WEB%" topic="%TOPIC%" title="This topic used to exist and was moved to: "}%</b></code>, you may want to use this in [[Main/WebTopicViewTemplate]] and [[Main/WebTopicNonWikiTemplate]]<br /><code><b>%METASEARCH{type="parent" web="%WEB%" topic="%TOPIC%" title="Children: "}%</b></code></td>
@@ -476,7 +475,7 @@ Most predefined variables return values that were either defined when TWiki was
 >
 > : 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]].
+> [2] **_Note_**: A web can be excluded from a <code>**web="all"**</code> search if you define a <code>**NOSEARCHALL=on**</code> variable in its [[WebPreferences]].
 
 ## <a name="Preferences Variables"></a> Preferences Variables
 
@@ -619,20 +618,23 @@ Additional variables are defined in the preferences ( site-level ( **_SL_** ) in
   </tr>
 </table>
 
+<a name="SettingPrefs"></a>
+
 ## <a name="Setting Preferences"></a> Setting Preferences
 
-- The syntax for Preferences variables is the same anywhere in TWiki. In Edit mode, from the start of a new line: <br />[6 spaces] \* [space] Set [space] VARIABLENAME [space] = [value] <br />**_Example:_**
-  - <code>**Set VARIABLENAME = value**</code>
+- The syntax for Preferences Bariables is the same anywhere in TWiki (on its own TWiki bullet line, including nested bullets): <br />[3 spaces] \* [space] Set [space] VARIABLENAME [space] = [value]<br />**_Examples:_**
+- <code>**Set VARIABLENAME = =value=**</code>
+  - <code>**Set VARIABLENAME = =value=**</code>
 
 ## <a name="Creating Custom Variables"></a> 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.
+- You can add your own Preference Variables for us across an entire site or a single web, using the standard [[Preferences syntax|Main/WebHome#SettingPrefs]]. Whatever you include in your Variable will be expanded on display, exactly as if it had been entered directly. You can place formatted text, page links, image paths.
 
-> **Example: Create a custom logo variable**
+> **Example: Create a custom logo variable the %WEB% web**
 >
 > <br />
 >
-> - To place a logo anywhere in a web by typing <code>**%MYLOGO%**</code>, 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|Main/FileAttachment]] to `LogoTopic` (any topic name you choose):
->   - <code>**Set MYLOGO = %PUBURL%/%MAINWEB%/LogoTopic/logo.gif**</code>
+> - To place a logo anywhere in a web by typing <code>**%MYLOGO%**</code>, define the Variable on the web's [[WebPreferences]] page, and upload a logo file, ex: `mylogo.gif`. You can upload by [[attaching the file|Main/FileAttachment]] to [[WebPreferences]], or, to avoid clutter, to any other topic in the same web, ex: `LogoTopic`:
+>   - <code>**Set MYLOGO = %PUBURL%/TWiki/LogoTopic/mylogo.gif**</code>
 
--- [[PeterThoeny]] - 13 Sep 2001 <br /> -- [[MikeMannix]] - 30 Nov 2001
+-- [[PeterThoeny]] - 13 Sep 2001 <br /> -- [[MikeMannix]] - 12 May 2002