none
[openafs-wiki.git] / TWiki / TWikiVariables.mdwn
index e929469..4107e35 100644 (file)
@@ -1,4 +1,8 @@
-TWiki expands the following variables enclosed in % percent signs:
+## <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">
   <tr>
@@ -7,15 +11,19 @@ TWiki expands the following variables enclosed in % percent signs:
   </tr>
   <tr>
     <td><code>%WIKIHOMEURL%</code></td>
-    <td> The base script URL of TWiki, link of Home icon in upper left corner, is <b>%WIKIHOMEURL%</b></td>
+    <td> The base script URL of %WIKITOOLNAME%, is the link of the Home icon in the upper left corner, is <b>%WIKIHOMEURL%</b></td>
   </tr>
   <tr>
     <td><code>%SCRIPTURL%</code></td>
-    <td> The script URL of TWiki, is <b>http://www.dementia.org/twiki/</b></td>
+    <td> The script URL of %WIKITOOLNAME%, is <b>http://www.dementia.org/twiki/</b></td>
   </tr>
   <tr>
     <td><code>%SCRIPTURLPATH%</code></td>
-    <td> The path of the script URL of TWiki, is <b>http://www.dementia.org/twiki/</b></td>
+    <td> The path of the script URL of %WIKITOOLNAME%, is <b>http://www.dementia.org/twiki/</b></td>
+  </tr>
+  <tr>
+    <td><code>%SCRIPTSUFFIX%</code></td>
+    <td> The script suffix, i.e. <code>.pl</code>, is <b></b></td>
   </tr>
   <tr>
     <td><code>%PUBURL%</code></td>
@@ -23,7 +31,7 @@ TWiki expands the following variables enclosed in % percent signs:
   </tr>
   <tr>
     <td><code>%PUBURLPATH%</code></td>
-    <td> The path of the public URL of TWiki, is <b>http://www.dementia.org/twiki//view</b></td>
+    <td> The path of the public URL of %WIKITOOLNAME%, is <b>http://www.dementia.org/twiki//view</b></td>
   </tr>
   <tr>
     <td><code>%ATTACHURL%</code></td>
@@ -34,6 +42,10 @@ TWiki expands the following variables enclosed in % percent signs:
     <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>
@@ -54,16 +66,98 @@ TWiki expands the following variables enclosed in % percent signs:
     <td> The current web, is <b>%WEB%</b></td>
   </tr>
   <tr>
+    <td><code>%BASEWEB%</code></td>
+    <td> The web name where the includes started, e.g. the web of the first topic of nested includes. Same as <code>%WEB%</code> in case there is no include. </td>
+  </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>
+  </tr>
+  <tr>
     <td><code>%TOPIC%</code></td>
     <td> The current topic name, is <b>%TOPIC%</b></td>
   </tr>
   <tr>
-    <td><code>%DATE%</code></td>
-    <td> Todays date (local server time), is <b>29 Jun 2010</b></td>
+    <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>
+  </tr>
+  <tr>
+    <td><code>%INCLUDINGTOPIC%</code></td>
+    <td> The name of the topic that includes the current topic. Same as <code>%TOPIC%</code> in case there is no include. </td>
+  </tr>
+  <tr>
+    <td><code>%SPACEDTOPIC%</code></td>
+    <td> The current topic name with added spaces, for regular expression search of Ref-By, is <b></b></td>
+  </tr>
+  <tr>
+    <td><code>%TOPICLIST{"format"}%</code></td>
+    <td> Topic index of a web. Parameter is composed of the format, followed by an optional <code>web="Name"</code>. The <code>"format"</code> defines the format of one topic item; use it to create any formatting you need. The <code>$name</code> variable is expanded to the topic name; the <code>$web</code> variable is expanded to the name of the web. Examples: <br /><code>%TOPICLIST{"   * $web.$name"}%</code> creates a bullet list of all topics. <br /><code>%TOPICLIST{" &lt;option&gt;$name&lt;/option&gt;"}%</code> creates an option list (for drop down menus). </td>
+  </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 is expanded to the name of the web. Example: <br /><code>%WEBLIST{"   * [[$name.WebHome]]"}%</code> creates a bullet list of all webs. </td>
   </tr>
   <tr>
     <td><code>%GMTIME%</code></td>
-    <td> Todays date (GM time), is <b>29 Jun 2010 - 15:24</b></td>
+    <td> GM time, is <b>29 Jun 2010 - 15:26</b></td>
+  </tr>
+  <tr>
+    <td><code>%GMTIME{"format"}%</code></td>
+    <td> Formatted GM time based on time variables. <table border="1" cellpadding="0" cellspacing="0">
+        <tr>
+          <th bgcolor="#99CCCC"><strong> Variable: </strong></th>
+          <th bgcolor="#99CCCC"><strong> Unit: </strong></th>
+          <th bgcolor="#99CCCC"><strong> Example </strong></th>
+        </tr>
+        <tr>
+          <td> $seconds </td>
+          <td> seconds </td>
+          <td> 59 </td>
+        </tr>
+        <tr>
+          <td> $minutes </td>
+          <td> minutes </td>
+          <td> 59 </td>
+        </tr>
+        <tr>
+          <td> $hours </td>
+          <td> hours </td>
+          <td> 23 </td>
+        </tr>
+        <tr>
+          <td> $day </td>
+          <td> day of month </td>
+          <td> 31 </td>
+        </tr>
+        <tr>
+          <td> $month </td>
+          <td> month in ISO format </td>
+          <td> Dec </td>
+        </tr>
+        <tr>
+          <td> $mo </td>
+          <td> 2 digit month </td>
+          <td> 12 </td>
+        </tr>
+        <tr>
+          <td> $year </td>
+          <td> 4 digit year </td>
+          <td> 1999 </td>
+        </tr>
+        <tr>
+          <td> $ye </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:26:32</b></td>
+  </tr>
+  <tr>
+    <td><code>%SERVERTIME%</code></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:26</b></td>
   </tr>
   <tr>
     <td><code>%HTTP_HOST%</code></td>
@@ -82,12 +176,24 @@ TWiki expands the following variables enclosed in % percent signs:
     <td> REMOTE_USER environment variable, is <b></b></td>
   </tr>
   <tr>
-    <td><code>%INCLUDE{"file.ext"}%</code></td>
-    <td> Server side include, includes the text of a file. The default directory is the current Wiki web. Example: <code><b>%INCLUDE{"../Know/TopicName.txt"}%</b></code></td>
+    <td><code>%INCLUDE{"SomeTopic"}%</code></td>
+    <td> Server side include, includes another topic. The current Wiki web is searched by default. Example: <code><b>%INCLUDE{"TWiki.TWikiWebsTable"}%</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><code>%STARTINCLUDE%</code></td>
+    <td> If present in included topic, start to include text from this location up to the end, or up to the location of the <code>%STOPINCLUDE%</code> variable. A normal view of the topic shows everyting exept the <code>%STARTINCLUDE%</code> variable itself. </td>
+  </tr>
+  <tr>
+    <td><code>%STOPINCLUDE%</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>"&lt;h2&gt;text&lt;h2&gt;"</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>
@@ -95,20 +201,60 @@ TWiki expands the following variables enclosed in % percent signs:
         </tr>
         <tr>
           <td><code>web="Name"</code></td>
-          <td> Specify Wiki web to search </td>
+          <td> Name of web </td>
           <td> Current web </td>
         </tr>
         <tr>
-          <td><code>scope="topic"</code></td>
-          <td> Search topic name (title) </td>
+          <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 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>[2]</code></td>
+          <td> Current web </td>
+        </tr>
+        <tr>
+          <td><code>scope="topic"</code><br /><code>scope="text"</code></td>
+          <td> Search topic name (title) or in the text (body) of the topic </td>
           <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> Sort by topic name </td>
+        </tr>
+        <tr>
+          <td><code>limit="all"</code><br /><code>limit="16"</code></td>
+          <td> Limit the number of results returned </td>
+          <td> All results </td>
+        </tr>
+        <tr>
           <td><code>regex="on"</code></td>
           <td>[[Main/RegularExpression]] search </td>
           <td> Literal search </td>
         </tr>
         <tr>
+          <td><code>reverse="on"</code></td>
+          <td> Reverse the direction of the search </td>
+          <td> Ascending search </td>
+        </tr>
+        <tr>
           <td><code>casesensitive="on"</code></td>
           <td> Case sensitive search </td>
           <td> Ignore case </td>
@@ -119,19 +265,43 @@ TWiki expands the following variables enclosed in % percent signs:
           <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>
+        </tr>
+        <tr>
           <td><code>nosearch="on"</code></td>
           <td> Suppress search string </td>
           <td> Show search string </td>
         </tr>
         <tr>
+          <td><code>noheader="on"</code></td>
+          <td> Suppress search header <br /><span style="background: #FFB0B0"> <strong>Topics: Changed: By:</strong> </span></td>
+          <td> Show search header </td>
+        </tr>
+        <tr>
           <td><code>nototal="on"</code></td>
           <td> Do not show number of topics found </td>
           <td> Show number </td>
         </tr>
       </table> Example: <code><b>%SEARCH{"wiki" web="Main" scope="topic"}%</b></code></td>
   </tr>
+  <tr>
+    <td><code>%VAR{"NAME" web="Web"}%</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>
+    </td>
+  </tr>
 </table>
 
+[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):
 
 <table border="1">
@@ -166,6 +336,21 @@ Additional variables are defined in the preferences ( site-level ( **_SL_** ) in
     <td> Background color of web </td>
   </tr>
   <tr>
+    <td><code>%NOSEARCHALL%</code></td>
+    <td><strong><em>WL</em></strong></td>
+    <td> Exclude web from a <code>web="all"</code> search (set variable to <code>on</code> for hidden webs) </td>
+  </tr>
+  <tr>
+    <td><code>%NEWTOPICBGCOLOR%</code></td>
+    <td><strong><em>SL</em></strong> , <em>UL</em></td>
+    <td> Background color of non existing topic. ( <strong><em>UL</em></strong> needs authentication for topic views ) </td>
+  </tr>
+  <tr>
+    <td><code>%NEWTOPICFONTCOLOR%</code></td>
+    <td><strong><em>SL</em></strong> , <em>UL</em></td>
+    <td> Font color of non existing topic. ( <strong><em>UL</em></strong> needs authentication for topic views ) </td>
+  </tr>
+  <tr>
     <td><code>%EDITBOXWIDTH%</code></td>
     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
     <td> Horizontal size of edit box, is <b> <code>%EDITBOXWIDTH%</code> </b></td>
@@ -180,6 +365,53 @@ Additional variables are defined in the preferences ( site-level ( **_SL_** ) in
     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
     <td> Default state of the link check box in the attach file page. Check box is initially checked if value is set to <code>CHECKED</code> , unchecked if empty. If checked, a link is created to the attached file at the end of the topic. Value is: <b><code>%ATTACHLINKBOX%</code></b></td>
   </tr>
+  <tr>
+    <td><code>%HTTP_EQUIV_ON_VIEW%</code></td>
+    <td><strong><em>SL</em></strong></td>
+    <td> http-equiv meta tags for view, rdiff, attach, search* scripts. </td>
+  </tr>
+  <tr>
+    <td><code>%HTTP_EQUIV_ON_EDIT%</code></td>
+    <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
+    <td> http-equiv meta tags for edit script. </td>
+  </tr>
+  <tr>
+    <td><code>%HTTP_EQUIV_ON_PREVIEW%</code></td>
+    <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
+    <td> http-equiv meta tags for preview script. </td>
+  </tr>
+  <tr>
+    <td><code>%DENYWEBCHANGE%</code></td>
+    <td><strong><em>WL</em></strong></td>
+    <td> List of users and groups who are <strong>not allowed</strong> to change topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
+  </tr>
+  <tr>
+    <td><code>%ALLOWWEBCHANGE%</code></td>
+    <td><strong><em>WL</em></strong></td>
+    <td> List of users and groups who are <strong>allowed</strong> to change topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
+  </tr>
+  <tr>
+    <td><code>%DENYTOPICCHANGE%</code></td>
+    <td><strong><em>(any topic)</em></strong></td>
+    <td> List of users and groups who are <strong>not allowed</strong> to change the current topic. (More in [[Main/TWikiAccessControl]]) </td>
+  </tr>
+  <tr>
+    <td><code>%ALLOWTOPICCHANGE%</code></td>
+    <td><strong><em>(any topic)</em></strong></td>
+    <td> List of users and groups who are <strong>allowed</strong> to change the current topic. (More in [[Main/TWikiAccessControl]]) </td>
+  </tr>
+  <tr>
+    <td><code>%FINALPREFERENCES%</code></td>
+    <td><strong><em>SL</em></strong> , <strong><em>WL</em></strong></td>
+    <td> List of preferences that are not allowed to be overridden by next level preferences</td>
+  </tr>
 </table>
 
--- [[PeterThoeny]] - 29 May 2000 <br />
+**_Notes:_**
+
+- Preferences variables ( on site-level, web-level and user level ) are defined by bullet lines with this syntax:
+  - `Set VARIABLENAME = value`
+- Additional preferences variables can be defined on all three level as needed. Example:
+  - `Set MYLOGO = %PUBURLPATH%/%MAINWEB%/LogoTopic/logo.gif`
+
+-- [[PeterThoeny]] - 24 Mar 2001 <br />