none
[openafs-wiki.git] / TWiki / TWikiVariables.mdwn
index 4386ad8..f5c9f89 100644 (file)
@@ -62,8 +62,33 @@ This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the
     <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>%ICON{"type"}%</code></td>
+    <td> Small 16x16 pixel icon of common attachment types, like <code>bmp</code>, <code>doc</code>, <code>gif</code>, <code>hlp</code>, <code>html</code>, <code>pdf</code>, <code>ppt</code>, <code>txt</code>, <code>wav</code>, <code>xml</code>, <code>zip</code>, etc. Specify file type only, file name, or full path name. Example: <code>%ICON{"pdf"}%</code> returns <img align="top" alt="pdf" border="0" height="16" src="http://www.dementia.org/twiki//view/Main/WebHome/pdf.gif" width="16" /></td>
+  </tr>
+  <tr>
     <td><code>%URLPARAM{"name"}%</code></td>
-    <td> Returns the value of a URL parameter. Ex: <code>%URLPARAM{"skin"}%</code> returns <b>print</b> for a <code>.../view/%WEB%/%TOPIC%?skin=print</code> URL. Is <b></b></td>
+    <td> Returns the value of a URL parameter. Note that there is a risk that this variable could be misused for cross-scripting. Parameters are name and newline: <table border="1" cellpadding="0" cellspacing="0">
+        <tr>
+          <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
+          <th bgcolor="#99CCCC"><strong> Description: </strong></th>
+          <th bgcolor="#99CCCC"><strong> Default: </strong></th>
+        </tr>
+        <tr>
+          <td><code>"name"</code></td>
+          <td> The name of a URL parameter </td>
+          <td> required </td>
+        </tr>
+        <tr>
+          <td><code>default="..."</code></td>
+          <td> Default value in case parameter is empty or missing </td>
+          <td> empty string </td>
+        </tr>
+        <tr>
+          <td><code>newline="&lt;br /&gt;"</code></td>
+          <td> Convert newlines to other delimiters </td>
+          <td> no conversion </td>
+        </tr>
+      </table> Example: <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>%URLENCODE{"string"}%</code></td>
@@ -217,11 +242,11 @@ This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the
           <td> Current value to be selected in list </td>
           <td><code>section="%WEB%"</code></td>
         </tr>
-      </table> Examples: <br /><code>%WEBLIST{"   * [[$name.WebHome]]"}%</code> creates a bullet list of all webs. <br /><code>%WEBLIST{"<select><option $marker="$marker" value="$qname">$name</option>" webs="Trash,public" selection="%WEB%" separator=" "}%</select></code> Dropdown of all public Webs + Trash Web, current Web highlighted. </td>
+      </table> Examples: <br /><code>%WEBLIST{"   * [[$name.WebHome]]"}%</code> creates a bullet list of all webs. <br /><code>%WEBLIST{"&lt;option $marker value=$qname&gt;$name&lt;/option&gt;" webs="Trash,public" selection="%WEB%" separator=" "}%</code> Dropdown of all public Webs + Trash Web, current Web highlighted. </td>
   </tr>
   <tr>
     <td><code>%GMTIME%</code></td>
-    <td> GM time, is <b>29 Jun 2010 - 15:36</b></td>
+    <td> GM time, is <b>29 Jun 2010 - 15:42</b></td>
   </tr>
   <tr>
     <td><code>%GMTIME{"format"}%</code></td>
@@ -271,15 +296,15 @@ This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the
           <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:36:04</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:42:15</b></td>
   </tr>
   <tr>
     <td><code>%SERVERTIME%</code></td>
-    <td> Server time, is <b>29 Jun 2010 - 11:36</b></td>
+    <td> Server time, is <b>29 Jun 2010 - 11:42</b></td>
   </tr>
   <tr>
     <td><code>%SERVERTIME{"format"}%</code></td>
-    <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:36</b></td>
+    <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:42</b></td>
   </tr>
   <tr>
     <td><code>%HTTP_HOST%</code></td>
@@ -299,18 +324,41 @@ This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the
   </tr>
   <tr>
     <td><code>%INCLUDE{"page" ...}%</code></td>
-    <td> Server side include to [[Main/IncludeTopicsAndWebPages]]. Parameters are page name, and an optional <code>pattern="(reg-exp)"</code>. The page name is: <table border="1" cellpadding="0" cellspacing="0">
+    <td> Server side include to [[Main/IncludeTopicsAndWebPages]]: <table border="1" cellpadding="0" cellspacing="0">
+        <tr>
+          <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
+          <th bgcolor="#99CCCC"><strong> Description: </strong></th>
+          <th bgcolor="#99CCCC"><strong> Default: </strong></th>
+        </tr>
         <tr>
           <td><code>"SomeTopic"</code></td>
           <td> The name of a topic located in the current web, i.e. <code>%INCLUDE{"WebNotify"}%</code></td>
+          <td>   </td>
         </tr>
         <tr>
           <td><code>"Web.Topic"</code></td>
           <td> A topic in another web, i.e. <code>%INCLUDE{"TWiki.SiteMap"}%</code></td>
+          <td>   </td>
         </tr>
         <tr>
           <td><code>"http://..."</code></td>
           <td> A full qualified URL, i.e. <code>%INCLUDE{"http://twiki.org/"}%</code></td>
+          <td>   </td>
+        </tr>
+        <tr>
+          <td><code>pattern="..."</code></td>
+          <td> A [[Main/RegularExpression]] pattern to include a subset of a topic or page </td>
+          <td> none </td>
+        </tr>
+        <tr>
+          <td><code>rev="1.2"</code></td>
+          <td> Include a previous topic revision; N/A for URLs </td>
+          <td> top revision </td>
+        </tr>
+        <tr>
+          <td><code>warn="off"</code></td>
+          <td> Warn if topic include fails: Fail silently (if <code>off</code>); output default warning (if set to <code>on</code>); else, output specific text (use <code>$topic</code> for topic name) </td>
+          <td><code>%INCLUDE- WARNING%</code> preferences setting </td>
         </tr>
       </table>
     </td>
@@ -329,7 +377,7 @@ This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the
   </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. Any heading text after <code>"!!"</code> is excluded from the TOC; for example, write <code>"---+!! text"</code> if you do not want to list a header in 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>
@@ -362,7 +410,7 @@ This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the
         </tr>
         <tr>
           <td><code>"text"</code></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> Search term. Is a regular expression or literal, depending on the <code>regex</code> parameter. For regular expressions ";" is 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>
@@ -392,7 +440,7 @@ This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the
         </tr>
         <tr>
           <td><code>regex="on"</code></td>
-          <td>[[Main/RegularExpression]] search </td>
+          <td>[[Main/RegularExpression]] search; also enables ";" as <em>and</em></td>
           <td> Literal search </td>
         </tr>
         <tr>
@@ -431,11 +479,11 @@ This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the
           <td> Show number </td>
         </tr>
         <tr>
-          <td><code><b>header="..."</b></code><br /><code><b>format="..."</b></code></td>
+          <td><code>header="..."</code><br /><code>format="..."</code></td>
           <td> Custom format results: see <strong>[[Main/FormattedSearch]]</strong> for usage, variables &amp; examples </td>
           <td> Results in table </td>
         </tr>
-      </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>
+      </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><br /> %H% If the TWiki:Plugins.TablePlugin is installed, you may set a <code>%TABLE{}%</code> variable just before the <code>%SEARCH{}%</code> to alter the output of a search. Example: <code><b>%TABLE{ tablewidth="90%" }%</b></code></td>
   </tr>
   <tr>
     <td><code>%METASEARCH{...}%</code></td>
@@ -481,6 +529,8 @@ This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the
 >
 > [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="PreferencesVariables"></a>
+
 ## <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):
@@ -542,6 +592,11 @@ Additional variables are defined in the preferences ( site-level ( **_SL_** ) in
     <td> Vertical size of edit box, is <b> <code>%EDITBOXHEIGHT%</code> </b></td>
   </tr>
   <tr>
+    <td><code>%EDITBOXSTYLE%</code></td>
+    <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
+    <td> Style of text edit box. Set to <code>width: 99%</code> for full window width (default; overwrites the EDITBOXWIDTH setting), or <code>width: auto</code> to disable. Value is: <b><code>%EDITBOXSTYLE%</code></b></td>
+  </tr>
+  <tr>
     <td><code>%RELEASEEDITLOCKCHECKBOX%</code></td>
     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
     <td> Default state of the "Release edit lock" ([[Main/UnlockTopic]]) check box in preview. Checkbox is initially checked if <code>Set RELEASEEDITLOCKCHECKBOX = checked="checked"</code>, or unchecked if empty. If checked, make sure to click on <u>Edit</u> to do more changes; do <strong>not</strong> go back in your browser to the edit page, or you risk that someone else will edit the topic at the same time! Value is: <b><code>%RELEASEEDITLOCKCHECKBOX%</code></b></td>
@@ -622,13 +677,33 @@ Additional variables are defined in the preferences ( site-level ( **_SL_** ) in
   </tr>
 </table>
 
+> **_Note:_**
+>
+> There are some more useful variables defined in the
+>
+> [[TWikiPreferences]]
+>
+> like
+>
+> `%BR%`
+>
+> for line break, colors like
+>
+> `%RED%`
+>
+> for colored text and small icons like
+>
+> `%H%`
+>
+> for a %H% Help icon.
+
 <a name="SettingPrefs"></a>
 
 ## <a name="Setting Preferences"></a> Setting Preferences
 
-- 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>
+- The syntax for Preferences Variables is the same anywhere in TWiki (on its own TWiki bullet line, including nested bullets): <br />[multiple of 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
 
@@ -641,4 +716,4 @@ Additional variables are defined in the preferences ( site-level ( **_SL_** ) in
 > - 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]] - 12 May 2002
+-- [[PeterThoeny]] - 19 Jan 2003 <br /> -- [[MikeMannix]] - 12 May 2002