77f3d1177c580e884ecd29d4d1a2d3f9f9385dad
[openafs-wiki.git] / TWiki / TWikiVariables.mdwn
1 ## <a name="TWiki Variables"></a> TWiki Variables
2
3 ### <a name="Predefined Variables"></a> Predefined Variables
4
5 %WIKITOOLNAME% expands the following variables enclosed in % percent signs:
6
7 <table border="1">
8   <tr>
9     <th> Variable: </th>
10     <th> Expanded to: </th>
11   </tr>
12   <tr>
13     <td><code>%WIKIHOMEURL%</code></td>
14     <td> The base script URL of %WIKITOOLNAME%, is the link of the Home icon in the upper left corner, is <b>%WIKIHOMEURL%</b></td>
15   </tr>
16   <tr>
17     <td><code>%SCRIPTURL%</code></td>
18     <td> The script URL of %WIKITOOLNAME%, is <b>http://www.dementia.org/twiki/</b></td>
19   </tr>
20   <tr>
21     <td><code>%SCRIPTURLPATH%</code></td>
22     <td> The path of the script URL of %WIKITOOLNAME%, is <b>http://www.dementia.org/twiki/</b></td>
23   </tr>
24   <tr>
25     <td><code>%SCRIPTSUFFIX%</code></td>
26     <td> The script suffix, i.e. <code>.pl</code>, is <b></b></td>
27   </tr>
28   <tr>
29     <td><code>%PUBURL%</code></td>
30     <td> The public URL of TWiki, is <b>http://www.dementia.org/twiki//view</b></td>
31   </tr>
32   <tr>
33     <td><code>%PUBURLPATH%</code></td>
34     <td> The path of the public URL of %WIKITOOLNAME%, is <b>http://www.dementia.org/twiki//view</b></td>
35   </tr>
36   <tr>
37     <td><code>%ATTACHURL%</code></td>
38     <td> The attachment URL of the current topic, is <b>http://www.dementia.org/twiki//view</b><br /> Example: If you attach a file you can refer to it as <code><b>%ATTACHURL%/image.gif</b></code></td>
39   </tr>
40   <tr>
41     <td><code>%ATTACHURLPATH%</code></td>
42     <td> The path of the attachment URL of the current topic, is <b>http://www.dementia.org/twiki//view</b></td>
43   </tr>
44   <tr>
45     <td><code>%WIKITOOLNAME%</code></td>
46     <td> Name of wiki tool, is <b>%WIKITOOLNAME%</b></td>
47   </tr>
48   <tr>
49     <td><code>%WIKIVERSION%</code></td>
50     <td> Wiki tool version, is <b>TWiki-4.1.2, Sat, 03 Mar 2007, build 13046</b></td>
51   </tr>
52   <tr>
53     <td><code>%USERNAME%</code></td>
54     <td> Your login username, is <b>admin</b></td>
55   </tr>
56   <tr>
57     <td><code>%WIKIUSERNAME%</code></td>
58     <td> Your Wiki username, if defined in [[Main/TWikiUsers]]. Same as %USERNAME% if not defined. Is <b>Main.admin</b></td>
59   </tr>
60   <tr>
61     <td><code>%WEB%</code></td>
62     <td> The current web, is <b>%WEB%</b></td>
63   </tr>
64   <tr>
65     <td><code>%BASEWEB%</code></td>
66     <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>
67   </tr>
68   <tr>
69     <td><code>%INCLUDINGWEB%</code></td>
70     <td> The web name of the topic that includes the current topic. Same as <code>%WEB%</code> in case there is no include. </td>
71   </tr>
72   <tr>
73     <td><code>%TOPIC%</code></td>
74     <td> The current topic name, is <b>%TOPIC%</b></td>
75   </tr>
76   <tr>
77     <td><code>%BASETOPIC%</code></td>
78     <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>
79   </tr>
80   <tr>
81     <td><code>%INCLUDINGTOPIC%</code></td>
82     <td> The name of the topic that includes the current topic. Same as <code>%TOPIC%</code> in case there is no include. </td>
83   </tr>
84   <tr>
85     <td><code>%SPACEDTOPIC%</code></td>
86     <td> The current topic name with added spaces, for regular expression search of Ref-By, is <b></b></td>
87   </tr>
88   <tr>
89     <td><code>%GMTIME%</code></td>
90     <td> GM time, is <b>29 Jun 2010 - 15:26</b></td>
91   </tr>
92   <tr>
93     <td><code>%GMTIME{"format"}%</code></td>
94     <td> Formatted GM time based on time variables. <table border="1" cellpadding="0" cellspacing="0">
95         <tr>
96           <th bgcolor="#99CCCC"><strong> Variable: </strong></th>
97           <th bgcolor="#99CCCC"><strong> Unit: </strong></th>
98           <th bgcolor="#99CCCC"><strong> Example </strong></th>
99         </tr>
100         <tr>
101           <td> $seconds </td>
102           <td> seconds </td>
103           <td> 59 </td>
104         </tr>
105         <tr>
106           <td> $minutes </td>
107           <td> minutes </td>
108           <td> 59 </td>
109         </tr>
110         <tr>
111           <td> $hours </td>
112           <td> hours </td>
113           <td> 23 </td>
114         </tr>
115         <tr>
116           <td> $day </td>
117           <td> day of month </td>
118           <td> 31 </td>
119         </tr>
120         <tr>
121           <td> $month </td>
122           <td> month in ISO format </td>
123           <td> Dec </td>
124         </tr>
125         <tr>
126           <td> $mo </td>
127           <td> 2 digit month </td>
128           <td> 12 </td>
129         </tr>
130         <tr>
131           <td> $year </td>
132           <td> 4 digit year </td>
133           <td> 1999 </td>
134         </tr>
135         <tr>
136           <td> $ye </td>
137           <td> 2 digit year </td>
138           <td> 99 </td>
139         </tr>
140       </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:18</b></td>
141   </tr>
142   <tr>
143     <td><code>%SERVERTIME%</code></td>
144     <td> Server time, is <b>29 Jun 2010 - 11:26</b></td>
145   </tr>
146   <tr>
147     <td><code>%SERVERTIME{"format"}%</code></td>
148     <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:26</b></td>
149   </tr>
150   <tr>
151     <td><code>%HTTP_HOST%</code></td>
152     <td> HTTP_HOST environment variable, is <b></b></td>
153   </tr>
154   <tr>
155     <td><code>%REMOTE_ADDR%</code></td>
156     <td> REMOTE_ADDR environment variable, is <b></b></td>
157   </tr>
158   <tr>
159     <td><code>%REMOTE_PORT%</code></td>
160     <td> REMOTE_PORT environment variable, is <b></b></td>
161   </tr>
162   <tr>
163     <td><code>%REMOTE_USER%</code></td>
164     <td> REMOTE_USER environment variable, is <b></b></td>
165   </tr>
166   <tr>
167     <td><code>%INCLUDE{"SomeTopic"}%</code></td>
168     <td> Server side include, includes another topic. The current Wiki web is searched by default. Example: <code><b>%INCLUDE{"TWiki.TWikiWebsTable"}%</b></code></td>
169   </tr>
170   <tr>
171     <td><code>%STARTINCLUDE%</code></td>
172     <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>
173   </tr>
174   <tr>
175     <td><code>%STOPINCLUDE%</code></td>
176     <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>
177   </tr>
178   <tr>
179     <td><code>%TOC%</code></td>
180     <td> Table of Content of current topic. </td>
181   </tr>
182   <tr>
183     <td><code>%TOC{"SomeTopic" ...}%</code></td>
184     <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">
185         <tr>
186           <th bgcolor="#99CCCC"><strong> Pair: </strong></th>
187           <th bgcolor="#99CCCC"><strong> Description: </strong></th>
188           <th bgcolor="#99CCCC"><strong> Default: </strong></th>
189         </tr>
190         <tr>
191           <td><code>web="Name"</code></td>
192           <td> Name of web </td>
193           <td> Current web </td>
194         </tr>
195         <tr>
196           <td><code>depth="2"</code></td>
197           <td> Limit depth of headings shown in TOC </td>
198           <td> 6 </td>
199         </tr>
200       </table> Examples: <code><b>%TOC{depth="2"}%</b></code>, <code><b>%TOC{"TWikiDocumentation" web="TWiki"}%</b></code></td>
201   </tr>
202   <tr>
203     <td><code>%SEARCH{"str" ...}%</code></td>
204     <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">
205         <tr>
206           <th bgcolor="#99CCCC"><strong> Pair: </strong></th>
207           <th bgcolor="#99CCCC"><strong> Description: </strong></th>
208           <th bgcolor="#99CCCC"><strong> Default: </strong></th>
209         </tr>
210         <tr>
211           <td><code>web="Name"</code><br /><code>web="Main Know"</code><br /><code>web="all"</code></td>
212           <td> Wiki web to search: A web, a list of webs separated by whitespace, or all webs <code>[1]</code></td>
213           <td> Current web </td>
214         </tr>
215         <tr>
216           <td><code>scope="topic"</code><br /><code>scope="text"</code></td>
217           <td> Search topic name (title) or in the text (body) of the topic </td>
218           <td> Topic text (body) </td>
219         </tr>
220         <tr>
221           <td><code>order="topic"</code><br /><code>order="modified"</code><br /><code>order="editby"</code></td>
222           <td> Sort the results of search by the topic names, last modified time, or last editor </td>
223           <td> Sort by topic name </td>
224         </tr>
225         <tr>
226           <td><code>limit="all"</code><br /><code>limit="16"</code></td>
227           <td> Limit the number of results returned </td>
228           <td> All results </td>
229         </tr>
230         <tr>
231           <td><code>regex="on"</code></td>
232           <td>[[Main/RegularExpression]] search </td>
233           <td> Literal search </td>
234         </tr>
235         <tr>
236           <td><code>reverse="on"</code></td>
237           <td> Reverse the direction of the search </td>
238           <td> Ascending search </td>
239         </tr>
240         <tr>
241           <td><code>casesensitive="on"</code></td>
242           <td> Case sensitive search </td>
243           <td> Ignore case </td>
244         </tr>
245         <tr>
246           <td><code>nosummary="on"</code></td>
247           <td> Show topic title only </td>
248           <td> Show topic summary </td>
249         </tr>
250         <tr>
251           <td><code>bookview="on"</code></td>
252           <td>[[Main/BookView]] search, e.g. show complete topic text </td>
253           <td> Show topic summary </td>
254         </tr>
255         <tr>
256           <td><code>nosearch="on"</code></td>
257           <td> Suppress search string </td>
258           <td> Show search string </td>
259         </tr>
260         <tr>
261           <td><code>noheader="on"</code></td>
262           <td> Suppress search header <br /><span style="background: #FFB0B0"> <strong>Topics: Changed: By:</strong> </span></td>
263           <td> Show search header </td>
264         </tr>
265         <tr>
266           <td><code>nototal="on"</code></td>
267           <td> Do not show number of topics found </td>
268           <td> Show number </td>
269         </tr>
270       </table> Example: <code><b>%SEARCH{"wiki" web="Main" scope="topic"}%</b></code></td>
271   </tr>
272   <tr>
273     <td><code>%VAR{"NAME" web="Web"}%</code></td>
274     <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>
275     <td>
276       <p>
277       </p>
278     </td>
279   </tr>
280 </table>
281
282 [1] **_Note_**: A web can be excluded from a `web="all"` search if you define a `NOSEARCHALL=on` variable in its [[WebPreferences]].
283
284 ### <a name="Preferences Variables"></a> Preferences Variables
285
286 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):
287
288 <table border="1">
289   <tr>
290     <th> Variable: </th>
291     <th> Level: </th>
292     <th> What: </th>
293   </tr>
294   <tr>
295     <td><code>%WIKIWEBMASTER%</code></td>
296     <td><strong><em>SL</em></strong></td>
297     <td> Webmaster email address (sender of email notifications) , is <b></b></td>
298   </tr>
299   <tr>
300     <td><code>%WIKIWEBLIST%</code></td>
301     <td><strong><em>SL</em></strong></td>
302     <td> List of %WIKITOOLNAME% webs (in upper right corner of topics) </td>
303   </tr>
304   <tr>
305     <td><code>%WEBTOPICLIST%</code></td>
306     <td><strong><em>WL</em></strong></td>
307     <td> Common links of web (second line of topics) </td>
308   </tr>
309   <tr>
310     <td><code>%WEBCOPYRIGHT%</code></td>
311     <td><strong><em>SL</em></strong> , <strong><em>WL</em></strong></td>
312     <td> Copyright notice (bottom right corner of topics) </td>
313   </tr>
314   <tr>
315     <td><code>%WEBBGCOLOR%</code></td>
316     <td><strong><em>WL</em></strong></td>
317     <td> Background color of web </td>
318   </tr>
319   <tr>
320     <td><code>%NOSEARCHALL%</code></td>
321     <td><strong><em>WL</em></strong></td>
322     <td> Exclude web from a <code>web="all"</code> search (set variable to <code>on</code> for hidden webs) </td>
323   </tr>
324   <tr>
325     <td><code>%NEWTOPICBGCOLOR%</code></td>
326     <td><strong><em>SL</em></strong> , <em>UL</em></td>
327     <td> Background color of non existing topic. ( <strong><em>UL</em></strong> needs authentication for topic views ) </td>
328   </tr>
329   <tr>
330     <td><code>%NEWTOPICFONTCOLOR%</code></td>
331     <td><strong><em>SL</em></strong> , <em>UL</em></td>
332     <td> Font color of non existing topic. ( <strong><em>UL</em></strong> needs authentication for topic views ) </td>
333   </tr>
334   <tr>
335     <td><code>%EDITBOXWIDTH%</code></td>
336     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
337     <td> Horizontal size of edit box, is <b> <code>%EDITBOXWIDTH%</code> </b></td>
338   </tr>
339   <tr>
340     <td><code>%EDITBOXHEIGHT%</code></td>
341     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
342     <td> Vertical size of edit box, is <b> <code>%EDITBOXHEIGHT%</code> </b></td>
343   </tr>
344   <tr>
345     <td><code>%ATTACHLINKBOX%</code></td>
346     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
347     <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>
348   </tr>
349   <tr>
350     <td><code>%HTTP_EQUIV_ON_VIEW%</code></td>
351     <td><strong><em>SL</em></strong></td>
352     <td> http-equiv meta tags for view, rdiff, attach, search* scripts. </td>
353   </tr>
354   <tr>
355     <td><code>%HTTP_EQUIV_ON_EDIT%</code></td>
356     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
357     <td> http-equiv meta tags for edit script. </td>
358   </tr>
359   <tr>
360     <td><code>%HTTP_EQUIV_ON_PREVIEW%</code></td>
361     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
362     <td> http-equiv meta tags for preview script. </td>
363   </tr>
364   <tr>
365     <td><code>%DENYWEBCHANGE%</code></td>
366     <td><strong><em>WL</em></strong></td>
367     <td> List of users and groups who are <strong>not allowed</strong> to change topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
368   </tr>
369   <tr>
370     <td><code>%ALLOWWEBCHANGE%</code></td>
371     <td><strong><em>WL</em></strong></td>
372     <td> List of users and groups who are <strong>allowed</strong> to change topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
373   </tr>
374   <tr>
375     <td><code>%DENYTOPICCHANGE%</code></td>
376     <td><strong><em>(any topic)</em></strong></td>
377     <td> List of users and groups who are <strong>not allowed</strong> to change the current topic. (More in [[Main/TWikiAccessControl]]) </td>
378   </tr>
379   <tr>
380     <td><code>%ALLOWTOPICCHANGE%</code></td>
381     <td><strong><em>(any topic)</em></strong></td>
382     <td> List of users and groups who are <strong>allowed</strong> to change the current topic. (More in [[Main/TWikiAccessControl]]) </td>
383   </tr>
384   <tr>
385     <td><code>%FINALPREFERENCES%</code></td>
386     <td><strong><em>SL</em></strong> , <strong><em>WL</em></strong></td>
387     <td> List of preferences that are not allowed to be overridden by next level preferences</td>
388   </tr>
389 </table>
390
391 **_Notes:_**
392
393 - Preferences variables ( on site-level, web-level and user level ) are defined by bullet lines with this syntax:
394   - `Set VARIABLENAME = value`
395 - Additional preferences variables can be defined on all three level as needed. Example:
396   - `Set MYLOGO = %PUBURLPATH%/%MAINWEB%/LogoTopic/logo.gif`
397
398 -- [[PeterThoeny]] - 15 Mar 2001 <br />