none
[openafs-wiki.git] / TWiki / TWikiVariables.mdwn
1 <div>
2   <ul>
3     <li><a href="#TWiki Variables"> TWiki Variables</a><ul>
4         <li><a href="#Predefined Variables"> Predefined Variables</a><ul>
5             <li><a href="#ATTACHURL -- attachment URL of t"> ATTACHURL -- attachment URL of the current topic</a></li>
6             <li><a href="#ATTACHURLPATH -- path of the att"> ATTACHURLPATH -- path of the attachment URL of the current topic</a></li>
7             <li><a href="#BASETOPIC -- base topic where an"> BASETOPIC -- base topic where an INCLUDE started</a></li>
8             <li><a href="#BASEWEB -- base web where an INC"> BASEWEB -- base web where an INCLUDE started</a></li>
9             <li><a href="#DISPLAYTIME -- display time"> DISPLAYTIME -- display time</a></li>
10             <li><a href="#DISPLAYTIME{"format"} -- formatt"> DISPLAYTIME{"format"} -- formatted display time</a></li>
11             <li><a href="#ENCODE{"string"} -- encodes a st"> ENCODE{"string"} -- encodes a string</a></li>
12             <li><a href="#GMTIME -- GM time"> GMTIME -- GM time</a></li>
13             <li><a href="#GMTIME{"format"} -- formatted GM"> GMTIME{"format"} -- formatted GM time</a></li>
14             <li><a href="#HOMETOPIC -- home topic in each"> HOMETOPIC -- home topic in each web</a></li>
15             <li><a href="#HTTP_HOST -- environment variabl"> HTTP_HOST -- environment variable</a></li>
16             <li><a href="#ICON{"type"} -- small icon of co"> ICON{"type"} -- small icon of common attachment types</a></li>
17             <li><a href="#INCLUDE{"page"} -- include other"> INCLUDE{"page"} -- include other topics or web pages</a></li>
18             <li><a href="#INCLUDINGTOPIC -- name of topic"> INCLUDINGTOPIC -- name of topic that includes current topic</a></li>
19             <li><a href="#INCLUDINGWEB -- web that include"> INCLUDINGWEB -- web that includes current topic</a></li>
20             <li><a href="#MAINWEB -- name of Main web"> MAINWEB -- name of Main web</a></li>
21             <li><a href="#METASEARCH -- special search of"> METASEARCH -- special search of meta data</a></li>
22             <li><a href="#NOTIFYTOPIC -- name of the notif"> NOTIFYTOPIC -- name of the notify topic</a></li>
23             <li><a href="#PUBURL -- the base URL of attach"> PUBURL -- the base URL of attachments</a></li>
24             <li><a href="#PUBURLPATH -- the base URL path"> PUBURLPATH -- the base URL path of attachments</a></li>
25             <li><a href="#REMOTE_ADDR -- environment varia"> REMOTE_ADDR -- environment variable</a></li>
26             <li><a href="#REMOTE_PORT -- environment varia"> REMOTE_PORT -- environment variable</a></li>
27             <li><a href="#REMOTE_USER -- environment varia"> REMOTE_USER -- environment variable</a></li>
28             <li><a href="#SCRIPTURL -- script URL of %WIKI"> SCRIPTURL -- script URL of %WIKITOOLNAME%</a></li>
29             <li><a href="#SCRIPTURLPATH -- script URL path"> SCRIPTURLPATH -- script URL path of %WIKITOOLNAME%</a></li>
30             <li><a href="#SCRIPTSUFFIX -- script suffix"> SCRIPTSUFFIX -- script suffix</a></li>
31             <li><a href="#SEARCH{"text"} -- search content"> SEARCH{"text"} -- search content</a></li>
32             <li><a href="#SERVERTIME -- server time"> SERVERTIME -- server time</a></li>
33             <li><a href="#SERVERTIME{"format"} -- formatte"> SERVERTIME{"format"} -- formatted server time</a></li>
34             <li><a href="#SPACEDTOPIC -- topic name, space"> SPACEDTOPIC -- topic name, spaced and encoded</a></li>
35             <li><a href="#STARTINCLUDE -- start position o"> STARTINCLUDE -- start position of topic text if included</a></li>
36             <li><a href="#STATISTICSTOPIC -- name of stati"> STATISTICSTOPIC -- name of statistics topic</a></li>
37             <li><a href="#STOPINCLUDE -- end position of t"> STOPINCLUDE -- end position of topic text if included</a></li>
38             <li><a href="#TOC -- table of contents of curr"> TOC -- table of contents of current topic</a></li>
39             <li><a href="#TOC{"Topic"} -- table of content"> TOC{"Topic"} -- table of contents</a></li>
40             <li><a href="#TOPIC -- name of current topic"> TOPIC -- name of current topic</a></li>
41             <li><a href="#TOPICLIST{"format"} -- topic ind"> TOPICLIST{"format"} -- topic index of a web</a></li>
42             <li><a href="#TWIKIWEB -- name of TWiki docume"> TWIKIWEB -- name of TWiki documentation web</a></li>
43             <li><a href="#URLPARAM{"name"} -- get value of"> URLPARAM{"name"} -- get value of a URL parameter</a></li>
44             <li><a href="#USERNAME -- your login username"> USERNAME -- your login username</a></li>
45             <li><a href="#VAR{"NAME" web="Web"} -- get a p"> VAR{"NAME" web="Web"} -- get a preference value from another web </a></li>
46             <li><a href="#WEB -- name of current web"> WEB -- name of current web</a></li>
47             <li><a href="#WEBLIST{"format"} -- index of al"> WEBLIST{"format"} -- index of all webs</a></li>
48             <li><a href="#WEBPREFSTOPIC -- name of web pre"> WEBPREFSTOPIC -- name of web preferences topic</a></li>
49             <li><a href="#WIKIHOMEURL -- site home URL"> WIKIHOMEURL -- site home URL</a></li>
50             <li><a href="#WIKINAME -- your Wiki username"> WIKINAME -- your Wiki username</a></li>
51             <li><a href="#WIKIPREFSTOPIC -- name of site-w"> WIKIPREFSTOPIC -- name of site-wide preferences topic</a></li>
52             <li><a href="#WIKITOOLNAME -- name of your TWi"> WIKITOOLNAME -- name of your TWiki site</a></li>
53             <li><a href="#WIKIUSERNAME -- your Wiki userna"> WIKIUSERNAME -- your Wiki username with web prefix</a></li>
54             <li><a href="#WIKIUSERSTOPIC -- name of topic"> WIKIUSERSTOPIC -- name of topic listing all registers users</a></li>
55             <li><a href="#WIKIVERSION -- the version of th"> WIKIVERSION -- the version of the installed TWiki engine</a></li>
56           </ul>
57         </li>
58         <li><a href="#Preferences Variables"> Preferences Variables</a></li>
59         <li><a href="#Setting Preferences"> Setting Preferences</a></li>
60         <li><a href="#Creating Custom Variables"> Creating Custom Variables</a></li>
61       </ul>
62     </li>
63   </ul>
64 </div>
65
66 # <a name="TWiki Variables"></a> TWiki Variables
67
68 _Special text strings expand on the fly to display user data or system info_
69
70 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.
71
72 **_Note:_** To leave a variable unexpanded, preceed it with an exclamation point, e.g. type `!%TOPIC%` to get %TOPIC%.
73
74 ## <a name="Predefined Variables"></a> Predefined Variables
75
76 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.
77
78 - %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>.
79
80 This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the following variables (enclosed in <code>**%**</code> percent signs):
81
82 <a name="VarATTACHURL"></a>
83
84 ### <a name="ATTACHURL -- attachment URL of t"></a> ATTACHURL -- attachment URL of the current topic
85
86 - Syntax: `%ATTACHURL%`
87 - Expands to: `http://www.dementia.org/twiki//view`
88 - Example: If you attach a file you can refer to it as `%ATTACHURL%/image.gif`
89 - Related: [[ATTACHURLPATH|Main/WebHome#VarATTACHURLPATH]], [[PUBURLPATH|Main/WebHome#VarPUBURLPATH]], [[SCRIPTURL|Main/WebHome#VarSCRIPTURL]], [[FileAttachments]]
90
91 <a name="VarATTACHURLPATH"></a>
92
93 ### <a name="ATTACHURLPATH -- path of the att"></a> ATTACHURLPATH -- path of the attachment URL of the current topic
94
95 - Syntax: `%ATTACHURLPATH%`
96 - Expands to: `http://www.dementia.org/twiki//view`
97 - Related: [[ATTACHURL|Main/WebHome#VarATTACHURL]], [[PUBURL|Main/WebHome#VarPUBURL]], [[FileAttachments]]
98
99 <a name="VarBASETOPIC"></a>
100
101 ### <a name="BASETOPIC -- base topic where an"></a> BASETOPIC -- base topic where an INCLUDE started
102
103 - The name of the topic where a single or nested INCLUDE started - same as `%TOPIC%` if there is no INCLUDE
104 - Syntax: `%BASETOPIC%`
105 - Related: [[BASEWEB|Main/WebHome#VarBASEWEB]], [[INCLUDINGTOPIC|Main/WebHome#VarINCLUDINGTOPIC]], [[INCLUDE|Main/WebHome#VarINCLUDE]], [[TOPIC|Main/WebHome#VarTOPIC]]
106
107 <a name="VarBASEWEB"></a>
108
109 ### <a name="BASEWEB -- base web where an INC"></a> BASEWEB -- base web where an INCLUDE started
110
111 - The web name where the includes started, e.g. the web of the first topic of nested includes. Same as `%WEB%` in case there is no include.
112 - Syntax: `%BASEWEB%`
113 - Related: [[BASETOPIC|Main/WebHome#VarBASETOPIC]], [[INCLUDINGWEB|Main/WebHome#VarINCLUDINGWEB]], [[INCLUDE|Main/WebHome#VarINCLUDE]], [[WEB|Main/WebHome#VarWEB]]
114
115 <a name="VarDISPLAYTIME"></a>
116
117 ### <a name="DISPLAYTIME -- display time"></a> DISPLAYTIME -- display time
118
119 - Syntax: `%DISPLAYTIME%`
120 - Expands to: `29 Jun 2010 - 15:45`
121 - Related: [[DISPLAYTIME{"format"}|Main/WebHome#VarDISPLAYTIME2]], [[GMTIME|Main/WebHome#VarGMTIME]], [[SERVERTIME|Main/WebHome#VarSERVERTIME]]
122
123 <a name="VarDISPLAYTIME2"></a>
124
125 ### <a name="DISPLAYTIME{&quot;format&quot;} -- formatt"></a> DISPLAYTIME\{"format"\} -- formatted display time
126
127 - Formatted time - either GMT or Local server time, depending on setting in TWiki.cfg. Same format qualifiers as `%GMTIME%`
128 - Syntax: `%DISPLAYTIME{"format"}%`
129 - Example: `%DISPLAYTIME{"$hou:$min"}%` expands to `15:45`
130 - Related: [[DISPLAYTIME|Main/WebHome#VarDISPLAYTIME]], [[GMTIME|Main/WebHome#VarGMTIME]], [[SERVERTIME|Main/WebHome#VarSERVERTIME]]
131
132 <a name="VarENCODE"></a>
133
134 ### <a name="ENCODE{&quot;string&quot;} -- encodes a st"></a> ENCODE\{"string"\} -- encodes a string
135
136 - Syntax: `%ENCODE{"string"}%`
137 - Supported parameters: <table border="1" cellpadding="0" cellspacing="0">
138   <tr>
139     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
140     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
141     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
142   </tr>
143   <tr>
144     <td><code>"string"</code></td>
145     <td> String to encode </td>
146     <td> required (can be empty) </td>
147   </tr>
148   <tr>
149     <td><code>type="entity"</code></td>
150     <td> Encode special characters into HTML entities, like a double quote into <code>&amp;#034;</code></td>
151     <td> URL encoding </td>
152   </tr>
153   <tr>
154     <td><code>type="url"</code></td>
155     <td> Encode special characters for URL parameter use, like a double quote into <code>%22</code></td>
156     <td> (this is the default) </td>
157   </tr>
158 </table>
159 - Example: `%ENCODE{"spaced name"}%` expands to `spaced%20name`
160 - Related: [[URLPARAM|Main/WebHome#VarURLPARAM]]
161
162 <a name="VarGMTIME"></a>
163
164 ### <a name="GMTIME -- GM time"></a> GMTIME -- GM time
165
166 - Syntax: `%GMTIME%`
167 - Expands to: `29 Jun 2010 - 15:45`
168 - Related: [[DISPLAYTIME|Main/WebHome#VarDISPLAYTIME]], [[GMTIME{"format"}|Main/WebHome#VarGMTIME2]], [[SERVERTIME|Main/WebHome#VarSERVERTIME]]
169
170 <a name="VarGMTIME2"></a>
171
172 ### <a name="GMTIME{&quot;format&quot;} -- formatted GM"></a> GMTIME\{"format"\} -- formatted GM time
173
174 - Syntax: `%GMTIME{"format"}%`
175 - Supported variables: <table border="1" cellpadding="0" cellspacing="0">
176   <tr>
177     <th bgcolor="#99CCCC"><strong> Variable: </strong></th>
178     <th bgcolor="#99CCCC"><strong> Unit: </strong></th>
179     <th bgcolor="#99CCCC"><strong> Example </strong></th>
180   </tr>
181   <tr>
182     <td><code>$seconds</code></td>
183     <td> seconds </td>
184     <td> 59 </td>
185   </tr>
186   <tr>
187     <td><code>$minutes</code></td>
188     <td> minutes </td>
189     <td> 59 </td>
190   </tr>
191   <tr>
192     <td><code>$hours</code></td>
193     <td> hours </td>
194     <td> 23 </td>
195   </tr>
196   <tr>
197     <td><code>$day</code></td>
198     <td> day of month </td>
199     <td> 31 </td>
200   </tr>
201   <tr>
202     <td><code>$wday</code></td>
203     <td> day of the Week (Sun, Mon, Tue, Wed, Thu, Fri, Sat) </td>
204     <td> Thu </td>
205   </tr>
206   <tr>
207     <td><code>$month</code></td>
208     <td> month in ISO format </td>
209     <td> Dec </td>
210   </tr>
211   <tr>
212     <td><code>$mo</code></td>
213     <td> 2 digit month </td>
214     <td> 12 </td>
215   </tr>
216   <tr>
217     <td><code>$year</code></td>
218     <td> 4 digit year </td>
219     <td> 1999 </td>
220   </tr>
221   <tr>
222     <td><code>$ye</code></td>
223     <td> 2 digit year </td>
224     <td> 99 </td>
225   </tr>
226   <tr>
227     <td><code>$tz</code></td>
228     <td> either "GMT" (if set to gmtime), or "Local" (if set to servertime) </td>
229     <td> GMT </td>
230   </tr>
231   <tr>
232     <td><code>$iso</code></td>
233     <td> ISO format timestamp </td>
234     <td> 2010-06-29T15:45:36Z </td>
235   </tr>
236   <tr>
237     <td><code>$rcs</code></td>
238     <td> RCS format timestamp </td>
239     <td> 2010/06/29 15:45:36 </td>
240   </tr>
241   <tr>
242     <td><code>$http</code></td>
243     <td> E-mail &amp; http format timestamp </td>
244     <td> Tue, 29 Jun 2010 15:45:36 GMT </td>
245   </tr>
246 </table>
247 - Variables can be shortened to 3 characters
248 - Example: `%GMTIME{"$day $month, $year - $hour:$min:$sec"}%` expands to `29 Jun, 2010 - 15:45:36`
249 - Related: [[DISPLAYTIME|Main/WebHome#VarDISPLAYTIME]], [[GMTIME|Main/WebHome#VarGMTIME]], [[SERVERTIME|Main/WebHome#VarSERVERTIME]]
250
251 <a name="VarHOMETOPIC"></a>
252
253 ### <a name="HOMETOPIC -- home topic in each"></a><a name="HOMETOPIC -- home topic in each "></a> HOMETOPIC -- home topic in each web
254
255 - Syntax: `%HOMETOPIC%`
256 - Expands to: `WebHome`, renders as [[WebHome]]
257 - Related: [[NOTIFYTOPIC|Main/WebHome#VarNOTIFYTOPIC]], [[STATISTICSTOPIC|Main/WebHome#VarSTATISTICSTOPIC]], [[TOPIC|Main/WebHome#VarTOPIC]]
258
259 <a name="VarHTTPHOST"></a>
260
261 ### <a name="HTTP_HOST -- environment variabl"></a> HTTP\_HOST -- environment variable
262
263 - Syntax: `%HTTP_HOST%`
264 - Expands to: ==
265 - Related: [[REMOTE_ADDR|Main/WebHome#VarREMOTEADDR]], [[REMOTE_PORT|Main/WebHome#VarREMOTEPORT]], [[REMOTE_USER|Main/WebHome#VarREMOTEUSER]]
266
267 <a name="VarICON"></a>
268
269 ### <a name="ICON{&quot;type&quot;} -- small icon of co"></a> ICON\{"type"\} -- small icon of common attachment types
270
271 - Small 16x16 pixel icon of common attachment types. Specify file type only, file name, or full path name
272 - Syntax: `%ICON{"type"}%`
273 - Samples: <img src="http://www.dementia.org/twiki//view/Main/WebHome/bmp.gif" width="16" height="16" alt="bmp" /> `bmp`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/doc.gif" width="16" height="16" alt="doc" /> `doc`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/gif.gif" width="16" height="16" alt="gif" /> `gif`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/hlp.gif" width="16" height="16" alt="hlp" /> `hlp`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/html.gif" width="16" height="16" alt="html" /> `html`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/mp3.gif" width="16" height="16" alt="mp3" /> `mp3`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/pdf.gif" width="16" height="16" alt="pdf" /> `pdf`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/ppt.gif" width="16" height="16" alt="ppt" /> `ppt`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/txt.gif" width="16" height="16" alt="txt" /> `txt`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/xls.gif" width="16" height="16" alt="xls" /> `xls`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/xml.gif" width="16" height="16" alt="xml" /> `xml`, <img src="http://www.dementia.org/twiki//view/Main/WebHome/zip.gif" width="16" height="16" alt="zip" /> `zip`
274 - Example: `%ICON{"pdf"}%` expands to <img src="http://www.dementia.org/twiki//view/Main/WebHome/pdf.gif" width="16" height="16" alt="pdf" />
275 - Related: [[TWikiPreferences]], [[FileAttachments]], [[TWikiDocGraphics]]
276
277 <a name="VarINCLUDE"></a>
278
279 ### <a name="INCLUDE{&quot;page&quot;} -- include other"></a> INCLUDE\{"page"\} -- include other topics or web pages
280
281 - Syntax: `%INCLUDE{"page" ...}%`
282 - Supported parameters: <table border="1" cellpadding="0" cellspacing="0">
283   <tr>
284     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
285     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
286     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
287   </tr>
288   <tr>
289     <td><code>"SomeTopic"</code></td>
290     <td> The name of a topic located in the current web, i.e. <code>%INCLUDE{"WebNotify"}%</code></td>
291     <td> Â  </td>
292   </tr>
293   <tr>
294     <td><code>"Web.Topic"</code></td>
295     <td> A topic in another web, i.e. <code>%INCLUDE{"TWiki.SiteMap"}%</code></td>
296     <td> Â  </td>
297   </tr>
298   <tr>
299     <td><code>"http://..."</code></td>
300     <td> A full qualified URL, i.e. <code>%INCLUDE{"http://twiki.org/"}%</code></td>
301     <td> Â  </td>
302   </tr>
303   <tr>
304     <td><code>pattern="..."</code></td>
305     <td> A [[Main/RegularExpression]] pattern to include a subset of a topic or page </td>
306     <td> none </td>
307   </tr>
308   <tr>
309     <td><code>rev="1.2"</code></td>
310     <td> Include a previous topic revision; N/A for URLs </td>
311     <td> top revision </td>
312   </tr>
313   <tr>
314     <td><code>warn="off"</code></td>
315     <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>
316     <td><code>%INCLUDE- WARNING%</code> [[Main/TWikiPreferences]] setting </td>
317   </tr>
318 </table>
319 - Related: [[BASETOPIC|Main/WebHome#VarBASETOPIC]], [[BASEWEB|Main/WebHome#VarBASEWEB]], [[INCLUDINGTOPIC|Main/WebHome#VarINCLUDINGTOPIC]], [[INCLUDINGWEB|Main/WebHome#VarINCLUDINGWEB]], [[IncludeTopicsAndWebPages]]
320
321 <a name="VarINCLUDINGTOPIC"></a>
322
323 ### <a name="INCLUDINGTOPIC -- name of topic"></a><a name="INCLUDINGTOPIC -- name of topic "></a> INCLUDINGTOPIC -- name of topic that includes current topic
324
325 - The name of the topic that includes the current topic - same as `%TOPIC%` in case there is no include
326 - Syntax: `%INCLUDINGTOPIC%`
327 - Related: [[BASETOPIC|Main/WebHome#VarBASETOPIC]], [[INCLUDINGWEB|Main/WebHome#VarINCLUDINGWEB]], [[INCLUDE|Main/WebHome#VarINCLUDE]], [[TOPIC|Main/WebHome#VarTOPIC]]
328
329 <a name="VarINCLUDINGWEB"></a>
330
331 ### <a name="INCLUDINGWEB -- web that include"></a> INCLUDINGWEB -- web that includes current topic
332
333 - The web name of the topic that includes the current topic - same as `%WEB%` if there is no INCLUDE.
334 - Syntax: `%INCLUDINGWEB%`
335 - Related: [[BASEWEB|Main/WebHome#VarBASEWEB]], [[INCLUDINGTOPIC|Main/WebHome#VarINCLUDINGTOPIC]], [[INCLUDE|Main/WebHome#VarINCLUDE]], [[WEB|Main/WebHome#VarWEB]]
336
337 <a name="VarMAINWEB"></a>
338
339 ### <a name="MAINWEB -- name of Main web"></a> MAINWEB -- name of Main web
340
341 - The web containing [[TWikiUsers]], [[OfficeLocations]] and [[TWikiGroups]]
342 - Syntax: `%MAINWEB%`
343 - Expands to: `Main`
344 - Related: [[TWIKIWEB|Main/WebHome#VarTWIKIWEB]]
345
346 <a name="VarMETASEARCH"></a>
347
348 ### <a name="METASEARCH -- special search of"></a><a name="METASEARCH -- special search of "></a> METASEARCH -- special search of meta data
349
350 - Syntax: `%METASEARCH{...}%`
351 - Supported parameters: <table border="1" cellpadding="0" cellspacing="0">
352   <tr>
353     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
354     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
355     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
356   </tr>
357   <tr>
358     <td><code>type="topicmoved"</code></td>
359     <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>
360     <td> required </td>
361   </tr>
362   <tr>
363     <td><code>web="%WEB%"</code></td>
364     <td> Wiki web to search: A web, a list of webs separated by whitespace, or <code>all</code> webs. </td>
365     <td> required </td>
366   </tr>
367   <tr>
368     <td><code>topic="%TOPIC%"</code></td>
369     <td> The topic the search relates to </td>
370     <td> required </td>
371   </tr>
372   <tr>
373     <td><code>title="Title"</code></td>
374     <td> Text that is prepended to any search results </td>
375     <td> required </td>
376   </tr>
377 </table>
378 - Example: `%METASEARCH{type="topicmoved" web="%WEB%" topic="%TOPIC%" title="This topic used to exist and was moved to: "}%`
379 - Example: You may want to use this in [[WebTopicViewTemplate]] and [[WebTopicNonWikiTemplate]]:<br />`%METASEARCH{type="parent" web="%WEB%" topic="%TOPIC%" title="Children: "}%`
380 - Related: [[SEARCH|Main/WebHome#VarSEARCH]]
381
382 <a name="VarNOTIFYTOPIC"></a>
383
384 ### <a name="NOTIFYTOPIC -- name of the notif"></a> NOTIFYTOPIC -- name of the notify topic
385
386 - Syntax: `%NOTIFYTOPIC%`
387 - Expands to: `WebNotify`, renders as [[WebNotify]]
388 - Related: [[HOMETOPIC|Main/WebHome#VarHOMETOPIC]], [[STATISTICSTOPIC|Main/WebHome#VarSTATISTICSTOPIC]], [[TOPIC|Main/WebHome#VarTOPIC]]
389
390 <a name="VarPUBURL"></a>
391
392 ### <a name="PUBURL -- the base URL of attach"></a> PUBURL -- the base URL of attachments
393
394 - Syntax: `%PUBURL%`
395 - Expands to: `http://www.dementia.org/twiki//view`
396 - Example: You can refer to a file attached to another topic with `%PUBURL%/%WEB%/OtherTopic/image.gif`
397 - Related: [[ATTACHURL|Main/WebHome#VarATTACHURL]], [[PUBURLPATH|Main/WebHome#VarPUBURLPATH]], [[SCRIPTURL|Main/WebHome#VarSCRIPTURL]], [[FileAttachments]]
398
399 <a name="VarPUBURLPATH"></a>
400
401 ### <a name="PUBURLPATH -- the base URL path"></a><a name="PUBURLPATH -- the base URL path "></a> PUBURLPATH -- the base URL path of attachments
402
403 - Syntax: `%PUBURLPATH%`
404 - Expands to: `http://www.dementia.org/twiki//view`
405 - Related: [[ATTACHURL|Main/WebHome#VarATTACHURL]], [[PUBURL|Main/WebHome#VarPUBURL]], [[FileAttachments]]
406
407 <a name="VarREMOTEADDR"></a>
408
409 ### <a name="REMOTE_ADDR -- environment varia"></a> REMOTE\_ADDR -- environment variable
410
411 - Syntax: `%REMOTE_ADDR%`
412 - Expands to: ==
413 - Related: [[HTTP_HOST|Main/WebHome#VarHTTPHOST]], [[REMOTE_PORT|Main/WebHome#VarREMOTEPORT]], [[REMOTE_USER|Main/WebHome#VarREMOTEUSER]]
414
415 <a name="VarREMOTEPORT"></a>
416
417 ### <a name="REMOTE_PORT -- environment varia"></a> REMOTE\_PORT -- environment variable
418
419 - Syntax: `%REMOTE_PORT%`
420 - Expands to: ``
421 - Related: [[HTTP_HOST|Main/WebHome#VarHTTPHOST]], [[REMOTE_ADDR|Main/WebHome#VarREMOTEADDR]], [[REMOTE_USER|Main/WebHome#VarREMOTEUSER]]
422
423 <a name="VarREMOTEUSER"></a>
424
425 ### <a name="REMOTE_USER -- environment varia"></a> REMOTE\_USER -- environment variable
426
427 - Syntax: `%REMOTE_USER%`
428 - Expands to: ``
429 - Related: [[HTTP_HOST|Main/WebHome#VarHTTPHOST]], [[REMOTE_ADDR|Main/WebHome#VarREMOTEADDR]], [[REMOTE_PORT|Main/WebHome#VarREMOTEPORT]], [[USERNAME|Main/WebHome#VarUSERNAME]], [[WIKINAME|Main/WebHome#VarWIKINAME]], [[WIKIUSERNAME|Main/WebHome#VarWIKIUSERNAME]]
430
431 <a name="VarSCRIPTURL"></a>
432
433 ### <a name="SCRIPTURL -- script URL of %WIKI"></a> SCRIPTURL -- script URL of %WIKITOOLNAME%
434
435 - Syntax: `%SCRIPTURL%`
436 - Expands to: `http://www.dementia.org/twiki/`
437 - Example: To get the authenticated version of current topic write `%SCRIPTURL%/viewauth%SCRIPTSUFFIX%/%WEB%/%TOPIC%` which expands to `http://www.dementia.org/twiki//viewauth/%WEB%/%TOPIC%`
438 - Related: [[PUBURL|Main/WebHome#VarPUBURL]], [[SCRIPTSUFFIX|Main/WebHome#VarSCRIPTSUFFIX]], [[SCRIPTURLPATH|Main/WebHome#VarSCRIPTURLPATH]]
439
440 <a name="VarSCRIPTURLPATH"></a>
441
442 ### <a name="SCRIPTURLPATH -- script URL path"></a> SCRIPTURLPATH -- script URL path of %WIKITOOLNAME%
443
444 - Syntax: `%SCRIPTURLPATH%`
445 - Expands to: `http://www.dementia.org/twiki/`
446 - Related: [[PUBURLPATH|Main/WebHome#VarPUBURLPATH]], [[SCRIPTURL|Main/WebHome#VarSCRIPTURL]]
447
448 <a name="VarSCRIPTSUFFIX"></a>
449
450 ### <a name="SCRIPTSUFFIX -- script suffix"></a> SCRIPTSUFFIX -- script suffix
451
452 - Some %WIKITOOLNAME% installations require a file extension for CGI scripts like `.pl` or `.cgi`
453 - Syntax: `%SCRIPTSUFFIX%`
454 - Expands to: ``
455 - Related: [[SCRIPTURL|Main/WebHome#VarSCRIPTURL]]
456
457 <a name="VarSEARCH"></a>
458
459 ### <a name="SEARCH{&quot;text&quot;} -- search content"></a> SEARCH\{"text"\} -- search content
460
461 - Inline search, shows a search result embedded in a topic
462 - Syntax: `%SEARCH{"text" ...}%`
463 - Supported parameters: [1] <table border="1" cellpadding="0" cellspacing="0">
464   <tr>
465     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
466     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
467     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
468   </tr>
469   <tr>
470     <td><code>"text"</code></td>
471     <td> Search term. Is a keyword search, literal search or regular expression search, depending on the <code>type</code> parameter. [[Main/SearchHelp]] has more </td>
472     <td> required </td>
473   </tr>
474   <tr>
475     <td><code>search="text"</code></td>
476     <td> (Alternative to above) </td>
477     <td> N/A </td>
478   </tr>
479   <tr>
480     <td><code>web="Name"</code><br /><code>web="Main, Know"</code><br /><code>web="all"</code></td>
481     <td> Wiki web to search: A web, a list of webs separated by comma, or <code>all</code> webs. [2] </td>
482     <td> Current web </td>
483   </tr>
484   <tr>
485     <td><code>topic="WebPreferences"</code><br /><code>topic="*Bug"</code></td>
486     <td> Limit search to topics: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. </td>
487     <td> All topics in a web </td>
488   </tr>
489   <tr>
490     <td><code>excludetopic="Web*"</code><br /><code>excludetopic="WebHome, WebChanges"</code></td>
491     <td> Exclude topics from search: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. </td>
492     <td> None </td>
493   </tr>
494   <tr>
495     <td><code>type="keyword"</code><br /><code>type="literal"</code><br /><code>type="regex"</code></td>
496     <td> Do a keyword search like <code>soap "web service" -shampoo</code>; a literal search like <code>web service</code>; or [[Main/RegularExpression]] search like <code>soap;web service;!shampoo</code></td>
497     <td><code>%SEARCHVAR- DEFAULTTYPE%</code> [[Main/TWikiPreferences]] setting (%SEARCHVARDEFAULTTYPE%) </td>
498   </tr>
499   <tr>
500     <td><code>scope="topic"</code><br /><code>scope="text"</code><br /><code>scope="all"</code></td>
501     <td> Search topic name (title); the text (body) of topic; or all (both) </td>
502     <td><code>"text"</code></td>
503   </tr>
504   <tr>
505     <td><code>order="topic"</code><br /><code>order="created"</code><br /><code>order="modified"</code><br /><code>order="editby"</code><br /><code>order=<br /> "formfield(name)"</code></td>
506     <td> Sort the results of search by the topic names, topic creation time, last modified time, last editor, or named field of [[Main/TWikiForms]]. The sorting is done web by web; in case you want to sort across webs, create a [[Main/FormattedSearch]] table and sort it with [[Main/TablePlugin]]'s initsort </td>
507     <td> Sort by topic name </td>
508   </tr>
509   <tr>
510     <td><code>limit="all"</code><br /><code>limit="16"</code></td>
511     <td> Limit the number of results returned. This is done after sorting in case <code>order</code> is specified </td>
512     <td> All results </td>
513   </tr>
514   <tr>
515     <td><code>reverse="on"</code></td>
516     <td> Reverse the direction of the search </td>
517     <td> Ascending search </td>
518   </tr>
519   <tr>
520     <td><code>casesensitive="on"</code></td>
521     <td> Case sensitive search </td>
522     <td> Ignore case </td>
523   </tr>
524   <tr>
525     <td><code>nosummary="on"</code></td>
526     <td> Show topic title only </td>
527     <td> Show topic summary </td>
528   </tr>
529   <tr>
530     <td><code>bookview="on"</code></td>
531     <td>[[Main/BookView]] search, e.g. show complete topic text </td>
532     <td> Show topic summary </td>
533   </tr>
534   <tr>
535     <td><code>nosearch="on"</code></td>
536     <td> Suppress search string </td>
537     <td> Show search string </td>
538   </tr>
539   <tr>
540     <td><code>noheader="on"</code></td>
541     <td> Suppress search header <br /><span style="background: #FFB0B0"> <strong>Topics: Changed: By:</strong> </span></td>
542     <td> Show search header </td>
543   </tr>
544   <tr>
545     <td><code>nototal="on"</code></td>
546     <td> Do not show number of topics found </td>
547     <td> Show number </td>
548   </tr>
549   <tr>
550     <td><code>header="..."</code><br /><code>format="..."</code></td>
551     <td> Custom format results: see <strong>[[Main/FormattedSearch]]</strong> for usage, variables &amp; examples </td>
552     <td> Results in table </td>
553   </tr>
554   <tr>
555     <td><code>expandvariables="on"</code></td>
556     <td> Expand variables before applying a [[Main/FormattedSearch]] on a search hit. Useful to show the expanded text, e.g. to show the result of a [[Main/SpreadSheetPlugin]] <code>%CALC{}%</code> instead of the formula </td>
557     <td> Raw text </td>
558   </tr>
559   <tr>
560     <td><code>multiple="on"</code></td>
561     <td> Multiple hits per topic. Each hit can be [[Main/FormattedSearch]]. The last token is used in case of a regular expression ";" <em>and</em> search </td>
562     <td> Only one hit per topic </td>
563   </tr>
564   <tr>
565     <td><code>separator=", "</code></td>
566     <td> Line separator between hits </td>
567     <td> Newline <code>"$n"</code></td>
568   </tr>
569 </table>
570 - Example: `%SEARCH{"wiki" web="Main" scope="topic"}%`
571 - Example with format: `%SEARCH{"FAQ" scope="topic" nosearch="on" nototal="on" header="| *Topic: * | *Summary: * |" format="| $topic | $summary |"%` _(displays results in a table with header - [[details|Main/FormattedSearch]])_
572 - %H% If the TWiki:Plugins.TablePlugin is installed, you may set a `%TABLE{}%` variable just before the `%SEARCH{}%` to alter the output of a search. Example: `%TABLE{ tablewidth="90%" }%`
573 - Related: [[METASEARCH|Main/WebHome#VarMETASEARCH]], [[TOPICLIST|Main/WebHome#VarTOPICLIST]], [[WEBLIST|Main/WebHome#VarWEBLIST]], [[FormattedSearch]]
574
575 - [1] **_Note_**: The search form uses identical names for input fields.
576 - [2] **_Note_**: A web can be excluded from a `web="all"` search if you define a `NOSEARCHALL=on` variable in its [[WebPreferences]]
577
578 <a name="VarSERVERTIME"></a>
579
580 ### <a name="SERVERTIME -- server time"></a> SERVERTIME -- server time
581
582 - Syntax: `%SERVERTIME%`
583 - Expands to: `29 Jun 2010 - 11:45`
584 - Related: [[DISPLAYTIME|Main/WebHome#VarDISPLAYTIME]], [[GMTIME|Main/WebHome#VarGMTIME]], [[SERVERTIME{"format"}|Main/WebHome#VarSERVERTIME2]]
585
586 <a name="VarSERVERTIME2"></a>
587
588 ### <a name="SERVERTIME{&quot;format&quot;} -- formatte"></a> SERVERTIME\{"format"\} -- formatted server time
589
590 - Same format qualifiers as `%GMTIME%`
591 - Syntax: `%SERVERTIME{"format"}%`
592 - Example: `%SERVERTIME{"$hou:$min"}%` expands to `11:45`
593 - Related: [[DISPLAYTIME|Main/WebHome#VarDISPLAYTIME]], [[GMTIME|Main/WebHome#VarGMTIME]], [[SERVERTIME|Main/WebHome#VarSERVERTIME]]
594
595 <a name="VarSPACEDTOPIC"></a>
596
597 ### <a name="SPACEDTOPIC -- topic name, space"></a> SPACEDTOPIC -- topic name, spaced and encoded
598
599 - The current topic name with added spaces, for regular expression search of Ref-By
600 - Syntax: `%SPACEDTOPIC%`
601 - Expands to: ==
602 - Related: [[TOPIC|Main/WebHome#VarTOPIC]]
603
604 <a name="VarSTARTINCLUDE"></a>
605
606 ### <a name="STARTINCLUDE -- start position o"></a> STARTINCLUDE -- start position of topic text if included
607
608 - If present in included topic, start to include text from this location up to the end, or up to the location of the `%STOPINCLUDE%` variable. A normal view of the topic shows everyting exept the `%STARTINCLUDE%` variable itself.
609 - Syntax: `%STARTINCLUDE%`
610 - Related: [[INCLUDE|Main/WebHome#VarINCLUDE]], [[STOPINCLUDE|Main/WebHome#VarSTOPINCLUDE]]
611
612 <a name="VarSTATISTICSTOPIC"></a>
613
614 ### <a name="STATISTICSTOPIC -- name of stati"></a> STATISTICSTOPIC -- name of statistics topic
615
616 - Syntax: `%STATISTICSTOPIC%`
617 - Expands to: `WebStatistics`, renders as [[WebStatistics]]
618 - Related: [[HOMETOPIC|Main/WebHome#VarHOMETOPIC]], [[NOTIFYTOPIC|Main/WebHome#VarNOTIFYTOPIC]], [[TOPIC|Main/WebHome#VarTOPIC]]
619
620 <a name="VarSTOPINCLUDE"></a>
621
622 ### <a name="STOPINCLUDE -- end position of t"></a> STOPINCLUDE -- end position of topic text if included
623
624 - 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 `%STOPINCLUDE%` variable itself.
625 - Syntax: `%STOPINCLUDE%`
626 - Related: [[INCLUDE|Main/WebHome#VarINCLUDE]], [[STARTINCLUDE|Main/WebHome#VarSTARTINCLUDE]]
627
628 <a name="VarTOC"></a>
629
630 ### <a name="TOC -- table of contents of curr"></a> TOC -- table of contents of current topic
631
632 - Syntax: `%TOC%`
633 - Related: [[TOC{"SomeTopic"}|Main/WebHome#VarTOC2]]
634
635 <a name="VarTOC2"></a>
636
637 ### <a name="TOC{&quot;Topic&quot;} -- table of content"></a> TOC\{"Topic"\} -- table of contents
638
639 - Syntax: `%TOC{"SomeTopic" ...}%`
640 - Table of Contents. Shows a TOC that is generated automatically based on headings of a topic. Headings in [[WikiSyntax]] (`"---++ text"`) and HTML (`"<h2>text</h2>"`) are taken into account. Any heading text after `"!!"` is excluded from the TOC; for example, write `"---+!! text"` if you do not want to list a header in the TOC
641 - Supported parameters: <table border="1" cellpadding="0" cellspacing="0">
642   <tr>
643     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
644     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
645     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
646   </tr>
647   <tr>
648     <td><code>"TopicName"</code></td>
649     <td> topic name </td>
650     <td> Current topic </td>
651   </tr>
652   <tr>
653     <td><code>web="Name"</code></td>
654     <td> Name of web </td>
655     <td> Current web </td>
656   </tr>
657   <tr>
658     <td><code>depth="2"</code></td>
659     <td> Limit depth of headings shown in TOC </td>
660     <td> 6 </td>
661   </tr>
662   <tr>
663     <td><code>title="Some text"</code></td>
664     <td> Title to appear at top of TOC </td>
665     <td> none </td>
666   </tr>
667 </table>
668 - Example: `%TOC{depth="2"}%`
669 - Example: `%TOC{"TWikiDocumentation" web="TWiki" title="Contents:"}%`
670 - Related: [[TOC|Main/WebHome#VarTOC]]
671
672 <a name="VarTOPIC"></a>
673
674 ### <a name="TOPIC -- name of current topic"></a> TOPIC -- name of current topic
675
676 - Syntax: `%TOPIC%`
677 - Expands to: `%TOPIC%`, renders as [[%TOPIC%|Main/TOPIC]]
678 - Related: [[BASETOPIC|Main/WebHome#VarBASETOPIC]], [[INCLUDINGTOPIC|Main/WebHome#VarINCLUDINGTOPIC]], [[TOPICLIST|Main/WebHome#VarTOPICLIST]], [[WEB|Main/WebHome#VarWEB]]
679
680 <a name="VarTOPICLIST"></a>
681
682 ### <a name="TOPICLIST{&quot;format&quot;} -- topic ind"></a> TOPICLIST\{"format"\} -- topic index of a web
683
684 - The "format" defines the format of one topic item. It may include variables: The `$name` variable gets expanded to the topic name; the `$web` variable gets expanded to the name of the web.
685 - Syntax: `%TOPICLIST{"format" ...}%`
686 - Supported parameters: <table border="1" cellpadding="0" cellspacing="0">
687   <tr>
688     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
689     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
690     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
691   </tr>
692   <tr>
693     <td><code>"format"</code></td>
694     <td> Format of one line, may include <code>$name</code> and <code>$web</code> variables </td>
695     <td><code>"$name"</code></td>
696   </tr>
697   <tr>
698     <td><code>format="format"</code></td>
699     <td> (Alternative to above) </td>
700     <td><code>"$name"</code></td>
701   </tr>
702   <tr>
703     <td><code>separator=", "</code></td>
704     <td> line separator </td>
705     <td><code>"\n"</code> (new line) </td>
706   </tr>
707   <tr>
708     <td><code>web="Name"</code></td>
709     <td> Name of web </td>
710     <td> Current web </td>
711   </tr>
712 </table>
713 - Example: `%TOPICLIST{" Â  * $web.$name"}%` creates a bullet list of all topics
714 - Example: `%TOPICLIST{separator=", "}%` creates a comma separated list of all topics
715 - Example: `%TOPICLIST{" <option>$name</option>"}%` creates an option list (for drop down menus)
716 - Related: [[SEARCH|Main/WebHome#VarSEARCH]], [[WEBLIST|Main/WebHome#VarWEBLIST]]
717
718 <a name="VarTWIKIWEB"></a>
719
720 ### <a name="TWIKIWEB -- name of TWiki docume"></a> TWIKIWEB -- name of TWiki documentation web
721
722 - The web containing all documentation and site-wide preference settings for %WIKITOOLNAME%
723 - Syntax: `%TWIKIWEB%`
724 - Expands to: `TWiki`
725 - Related: [[MAINWEB|Main/WebHome#VarMAINWEB]]
726
727 <a name="VarURLPARAM"></a>
728
729 ### <a name="URLPARAM{&quot;name&quot;} -- get value of"></a> URLPARAM\{"name"\} -- get value of a URL parameter
730
731 - Returns the value of a URL parameter. Note that there is a risk that this variable could be misused for cross-scripting
732 - Syntax: `%URLPARAM{"name"}%`
733 - Supported parameters: <table border="1" cellpadding="0" cellspacing="0">
734   <tr>
735     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
736     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
737     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
738   </tr>
739   <tr>
740     <td><code>"name"</code></td>
741     <td> The name of a URL parameter </td>
742     <td> required </td>
743   </tr>
744   <tr>
745     <td><code>default="..."</code></td>
746     <td> Default value in case parameter is empty or missing </td>
747     <td> empty string </td>
748   </tr>
749   <tr>
750     <td><code>newline="&lt;br /&gt;"</code></td>
751     <td> Convert newlines in textarea to other delimiters </td>
752     <td> no conversion </td>
753   </tr>
754   <tr>
755     <td><code>encode="entity"</code></td>
756     <td> Encode special characters into HTML entities, like a double quote into <code>&amp;#034;</code>. This is needed if text is put into an HTML form field </td>
757     <td> no encoding </td>
758   </tr>
759   <tr>
760     <td><code>encode="url"</code></td>
761     <td> Encode special characters for URL parameter use, like a double quote into <code>%22</code></td>
762     <td> no encoding </td>
763   </tr>
764   <tr>
765     <td><code>multiple="on"</code> %BR% <code>multiple="[[$item]]"</code></td>
766     <td> If set, gets all selected elements of a <code>&lt;select multiple="multiple"&gt;</code> tag. A format can be specified, with <code>$item</code> indicating the element, e.g. <code>multiple="Option: $item"</code></td>
767     <td> first element </td>
768   </tr>
769   <tr>
770     <td><code>separator=", "</code></td>
771     <td> Separator between multiple selections. Only relevant if multiple is specified </td>
772     <td><code>"\n"</code> (new line) </td>
773   </tr>
774 </table>
775 - Example: `%URLPARAM{"skin"}%` returns `print` for a `.../view/%WEB%/%TOPIC%?skin=print` URL. [Test this](http://www.dementia.org/twiki//viewauth/%WEB%/%TOPIC%?skin=print#VarURLPARAM):
776 - Related: [[SEARCH|Main/WebHome#VarSEARCH]], [[FormattedSearch]]
777
778 <a name="VarUSERNAME"></a>
779
780 ### <a name="USERNAME -- your login username"></a> USERNAME -- your login username
781
782 - TWiki makes names available in three formats: USERNAME like `jsmith`, WIKINAME like `JohnSmith` and WIKIUSERNAME like `Main.JohnSmith`. A user is a [[TWikiGuest]] in case the topic is not authenticated
783 - Syntax: `%USERNAME%`
784 - Expands to: `admin`
785 - Related: [[REMOTE_USER|Main/WebHome#VarREMOTEUSER]], [[WIKINAME|Main/WebHome#VarWIKINAME]], [[WIKIUSERNAME|Main/WebHome#VarWIKIUSERNAME]], [[TWikiUserAuthentication]]
786
787 <a name="VarVAR"></a>
788
789 ### <a name="VAR{&quot;NAME&quot; web=&quot;Web&quot;} -- get a p"></a> VAR\{"NAME" web="Web"\} -- get a preference value from another web
790
791 - Syntax: `%VAR{"NAME" web="Web"}%`
792 - Example: To get `%WEBBGCOLOR%` of the Main web write `%VAR{"WEBBGCOLOR" web="Main"}%`, which expands to ==
793 - Related: [[WEBPREFSTOPIC|Main/WebHome#VarWEBPREFSTOPIC]]
794
795 <a name="VarWEB"></a>
796
797 ### <a name="WEB -- name of current web"></a> WEB -- name of current web
798
799 - Syntax: `%WEB%`
800 - Expands to: `%WEB%`
801 - Related: [[BASEWEB|Main/WebHome#VarBASEWEB]], [[INCLUDINGWEB|Main/WebHome#VarINCLUDINGWEB]], [[TOPIC|Main/WebHome#VarTOPIC]]
802
803 <a name="VarWEBLIST"></a>
804
805 ### <a name="WEBLIST{&quot;format&quot;} -- index of al"></a> WEBLIST\{"format"\} -- index of all webs
806
807 - List of all webs. Hidden webs are excluded, e.g. webs with a `NOSEARCHALL=on` preference variable. The `"format"` defines the format of one web item. The `$name` variable gets expanded to the name of the web, `$qname` gets expanded to double quoted name, `$marker` to `marker` where web matches `selection`.
808 - Syntax: `%WEBLIST{"format" ...}%`
809 - Supported parameters: <table border="1" cellpadding="0" cellspacing="0">
810   <tr>
811     <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
812     <th bgcolor="#99CCCC"><strong> Description: </strong></th>
813     <th bgcolor="#99CCCC"><strong> Default: </strong></th>
814   </tr>
815   <tr>
816     <td><code>"format"</code></td>
817     <td> Format of one line, may include <code>$name</code> variable </td>
818     <td><code>"$name"</code></td>
819   </tr>
820   <tr>
821     <td><code>format="format"</code></td>
822     <td> (Alternative to above) </td>
823     <td><code>"$name"</code></td>
824   </tr>
825   <tr>
826     <td><code>separator=", "</code></td>
827     <td> line separator </td>
828     <td><code>"\n"</code> (new line) </td>
829   </tr>
830   <tr>
831     <td><code>webs="public"</code></td>
832     <td> comma sep list of Web, public expands to all non-hidden </td>
833     <td><code>"public"</code></td>
834   </tr>
835   <tr>
836     <td><code>marker="selected"</code></td>
837     <td> Text for <code>$marker</code> where item matches <code>selection</code>, otherwise equals <code>""</code></td>
838     <td><code>"selected"</code></td>
839   </tr>
840   <tr>
841     <td><code>selection="%WEB%"</code></td>
842     <td> Current value to be selected in list </td>
843     <td><code>section="%WEB%"</code></td>
844   </tr>
845 </table>
846 - Example: `%WEBLIST{" Â  * [[$name.WebHome]]"}%` creates a bullet list of all webs.
847 - Example: `%WEBLIST{"<option $marker value=$qname>$name</option>" webs="Trash,public" selection="%WEB%" separator=" "}%` Dropdown of all public Webs + Trash Web, current Web highlighted.
848 - Related: [[TOPICLIST|Main/WebHome#VarTOPICLIST]], [[SEARCH|Main/WebHome#VarSEARCH]]
849
850 <a name="VarWEBPREFSTOPIC"></a>
851
852 ### <a name="WEBPREFSTOPIC -- name of web pre"></a> WEBPREFSTOPIC -- name of web preferences topic
853
854 - Syntax: `%WEBPREFSTOPIC%`
855 - Expands to: `WebPreferences`, renders as [[WebPreferences]]
856 - Related: [[HOMETOPIC|Main/WebHome#VarHOMETOPIC]], [[WIKIPREFSTOPIC|Main/WebHome#VarWIKIPREFSTOPIC]], [[VAR|Main/WebHome#VarVAR]]
857
858 <a name="VarWIKIHOMEURL"></a>
859
860 ### <a name="WIKIHOMEURL -- site home URL"></a> WIKIHOMEURL -- site home URL
861
862 - The base URL of %WIKITOOLNAME%, is the link of the Home icon in the upper left corner, defined in TWiki.cfg
863 - Syntax: `%WIKIHOMEURL%`
864 - Expands to: `%WIKIHOMEURL%`
865 - Related: [[WIKITOOLNAME|Main/WebHome#VarWIKITOOLNAME]]
866
867 <a name="VarWIKINAME"></a>
868
869 ### <a name="WIKINAME -- your Wiki username"></a> WIKINAME -- your Wiki username
870
871 - The [[WikiName]] is the same as %USERNAME% if not defined in the [[TWikiUsers]] topic
872 - Syntax: `%WIKINAME%`
873 - Expands to: `admin`
874 - Related: [[REMOTE_USER|Main/WebHome#VarREMOTEUSER]], [[USERNAME|Main/WebHome#VarUSERNAME]], [[WIKIUSERNAME|Main/WebHome#VarWIKIUSERNAME]], [[WIKIUSERSTOPIC|Main/WebHome#VarWIKIUSERSTOPIC]]
875
876 <a name="VarWIKIPREFSTOPIC"></a>
877
878 ### <a name="WIKIPREFSTOPIC -- name of site-w"></a> WIKIPREFSTOPIC -- name of site-wide preferences topic
879
880 - Syntax: `%WIKIPREFSTOPIC%`
881 - Expands to: `TWikiPreferences`, renders as [[TWikiPreferences]]
882 - Related: [[HOMETOPIC|Main/WebHome#VarHOMETOPIC]], [[WEBPREFSTOPIC|Main/WebHome#VarWEBPREFSTOPIC]]
883
884 <a name="VarWIKITOOLNAME"></a>
885
886 ### <a name="WIKITOOLNAME -- name of your TWi"></a> WIKITOOLNAME -- name of your TWiki site
887
888 - Syntax: `%WIKITOOLNAME%`
889 - Expands to: `%WIKITOOLNAME%`
890 - Related: [[WIKIHOMEURL|Main/WebHome#VarWIKIHOMEURL]], [[WIKIVERSION|Main/WebHome#VarWIKIVERSION]]
891
892 <a name="VarWIKIUSERNAME"></a>
893
894 ### <a name="WIKIUSERNAME -- your Wiki userna"></a> WIKIUSERNAME -- your Wiki username with web prefix
895
896 - Your %WIKINAME% with Main web prefix, useful to point to your %WIKITOOLNAME% home page
897 - Syntax: `%WIKIUSERNAME%`
898 - Expands to: `Main.admin`, renders as Main.admin
899 - Related: [[REMOTE_USER|Main/WebHome#VarREMOTEUSER]], [[USERNAME|Main/WebHome#VarUSERNAME]], [[WIKINAME|Main/WebHome#VarWIKINAME]]
900
901 <a name="VarWIKIUSERSTOPIC"></a>
902
903 ### <a name="WIKIUSERSTOPIC -- name of topic"></a><a name="WIKIUSERSTOPIC -- name of topic "></a> WIKIUSERSTOPIC -- name of topic listing all registers users
904
905 - Syntax: `%WIKIUSERSTOPIC%`
906 - Expands to: `TWikiUsers`, with Main prefix renders as [[TWikiUsers]]
907 - Related: [[WIKIUSERNAME|Main/WebHome#VarWIKIUSERNAME]]
908
909 <a name="VarWIKIVERSION"></a>
910
911 ### <a name="WIKIVERSION -- the version of th"></a> WIKIVERSION -- the version of the installed TWiki engine
912
913 - Syntax: `%WIKIVERSION%`
914 - Expands to: `TWiki-4.1.2, Sat, 03 Mar 2007, build 13046`
915 - Related: [[WIKITOOLNAME|Main/WebHome#VarWIKITOOLNAME]]
916
917 <a name="PreferencesVariables"></a>
918
919 ## <a name="Preferences Variables"></a> Preferences Variables
920
921 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):
922
923 <table align="center" border="1" cellpadding="2" cellspacing="0" style="background-color: #f5f5f5">
924   <tr>
925     <th width="160"> Variable: </th>
926     <th> Level: </th>
927     <th> What: </th>
928   </tr>
929   <tr>
930     <td><code>%ALLOWTOPICCHANGE%</code></td>
931     <td><strong><em>(any topic)</em></strong></td>
932     <td> List of users and groups who are <strong>allowed</strong> to change the current topic. (More in [[Main/TWikiAccessControl]]) </td>
933   </tr>
934   <tr>
935     <td><code>%ALLOWTOPICRENAME%</code></td>
936     <td><strong><em>(any topic)</em></strong></td>
937     <td> List of users and groups who are <strong>allowed</strong> to rename the current topic. (More in [[Main/TWikiAccessControl]]) </td>
938   </tr>
939   <tr>
940     <td><code>%ALLOWWEBCHANGE%</code></td>
941     <td><strong><em>WL</em></strong></td>
942     <td> List of users and groups who are <strong>allowed</strong> to change topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
943   </tr>
944   <tr>
945     <td><code>%ALLOWWEBRENAME%</code></td>
946     <td><strong><em>WL</em></strong></td>
947     <td> List of users and groups who are <strong>allowed</strong> to rename topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
948   </tr>
949   <tr>
950     <td><code>%ATTACHLINKBOX%</code></td>
951     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
952     <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>
953   </tr>
954   <tr>
955     <td><code>%DENYTOPICCHANGE%</code></td>
956     <td><strong><em>(any topic)</em></strong></td>
957     <td> List of users and groups who are <strong>not allowed</strong> to change the current topic. (More in [[Main/TWikiAccessControl]]) </td>
958   </tr>
959   <tr>
960     <td><code>%DENYTOPICRENAME%</code></td>
961     <td><strong><em>(any topic)</em></strong></td>
962     <td> List of users and groups who are <strong>not allowed</strong> to rename the current topic. (More in [[Main/TWikiAccessControl]]) </td>
963   </tr>
964   <tr>
965     <td><code>%DENYWEBCHANGE%</code></td>
966     <td><strong><em>WL</em></strong></td>
967     <td> List of users and groups who are <strong>not allowed</strong> to change topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
968   </tr>
969   <tr>
970     <td><code>%DENYWEBRENAME%</code></td>
971     <td><strong><em>WL</em></strong></td>
972     <td> List of users and groups who are <strong>not allowed</strong> to rename topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
973   </tr>
974   <tr>
975     <td><code>%DONTNOTIFYCHECKBOX%</code></td>
976     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
977     <td> Default state of the "Minor Changes, Don't Notify" ([[Main/DontNotify]]) check box in preview. Check box is initially checked if <code>Set DONTNOTIFYCHECKBOX = checked="checked"</code>, or unchecked if empty. Value is: <b><code>%DONTNOTIFYCHECKBOX%</code></b></td>
978   </tr>
979   <tr>
980     <td><code>%EDITBOXHEIGHT%</code></td>
981     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
982     <td> Vertical size of edit box, is <b> <code>%EDITBOXHEIGHT%</code> </b></td>
983   </tr>
984   <tr>
985     <td><code>%EDITBOXWIDTH%</code></td>
986     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
987     <td> Horizontal size of edit box, is <b> <code>%EDITBOXWIDTH%</code> </b></td>
988   </tr>
989   <tr>
990     <td><code>%EDITBOXSTYLE%</code></td>
991     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
992     <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>
993   </tr>
994   <tr>
995     <td><code>%FINALPREFERENCES%</code></td>
996     <td><strong><em>SL</em></strong> , <strong><em>WL</em></strong></td>
997     <td> List of preferences that are not allowed to be overridden by next level preferences</td>
998   </tr>
999   <tr>
1000     <td><code>%HTTP_EQUIV_ON_EDIT%</code></td>
1001     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
1002     <td> http-equiv meta tags for edit script. </td>
1003   </tr>
1004   <tr>
1005     <td><code>%HTTP_EQUIV_ON_PREVIEW%</code></td>
1006     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
1007     <td> http-equiv meta tags for preview script. </td>
1008   </tr>
1009   <tr>
1010     <td><code>%HTTP_EQUIV_ON_VIEW%</code></td>
1011     <td><strong><em>SL</em></strong></td>
1012     <td> http-equiv meta tags for view, rdiff, attach, search* scripts. </td>
1013   </tr>
1014   <tr>
1015     <td><code>%NEWTOPICBGCOLOR%</code></td>
1016     <td><strong><em>SL</em></strong> , <em>UL</em></td>
1017     <td> Background color of non existing topic. ( <strong><em>UL</em></strong> needs authentication for topic views ) </td>
1018   </tr>
1019   <tr>
1020     <td><code>%NEWTOPICFONTCOLOR%</code></td>
1021     <td><strong><em>SL</em></strong> , <em>UL</em></td>
1022     <td> Font color of non existing topic. ( <strong><em>UL</em></strong> needs authentication for topic views ) </td>
1023   </tr>
1024   <tr>
1025     <td><code>%NOSEARCHALL%</code></td>
1026     <td><strong><em>WL</em></strong></td>
1027     <td> Exclude web from a <code>web="all"</code> search (set variable to <code>on</code> for hidden webs) </td>
1028   </tr>
1029   <tr>
1030     <td><code>%RELEASEEDITLOCKCHECKBOX%</code></td>
1031     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
1032     <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>
1033   </tr>
1034   <tr>
1035     <td><code>%WEBBGCOLOR%</code></td>
1036     <td><strong><em>WL</em></strong></td>
1037     <td> Background color of web </td>
1038   </tr>
1039   <tr>
1040     <td><code>%WEBCOPYRIGHT%</code></td>
1041     <td><strong><em>SL</em></strong> , <strong><em>WL</em></strong></td>
1042     <td> Copyright notice (bottom right corner of topics) </td>
1043   </tr>
1044   <tr>
1045     <td><code>%WEBTOPICLIST%</code></td>
1046     <td><strong><em>WL</em></strong></td>
1047     <td> Common links of web (second line of topics) </td>
1048   </tr>
1049   <tr>
1050     <td><code>%WIKIWEBLIST%</code></td>
1051     <td><strong><em>SL</em></strong></td>
1052     <td> List of %WIKITOOLNAME% webs (in upper right corner of topics) </td>
1053   </tr>
1054   <tr>
1055     <td><code>%WIKIWEBMASTER%</code></td>
1056     <td><strong><em>SL</em></strong></td>
1057     <td> Webmaster email address (sender of email notifications) , is <b></b></td>
1058   </tr>
1059 </table>
1060
1061 **_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.
1062
1063 <a name="SettingPrefs"></a>
1064
1065 ## <a name="Setting Preferences"></a> Setting Preferences
1066
1067 - 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:_**
1068 - <code>**Set VARIABLENAME = value**</code>
1069   - <code>**Set VARIABLENAME = value**</code>
1070
1071 ## <a name="Creating Custom Variables"></a> Creating Custom Variables
1072
1073 - 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.
1074
1075 > **Example: Create a custom logo variable the %WEB% web**
1076 >
1077 > <br />
1078 >
1079 > - 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`:
1080 >   - <code>**Set MYLOGO = %PUBURL%/TWiki/LogoTopic/mylogo.gif**</code>
1081
1082 -- TWiki:Main.PeterThoeny - 09 May 2004 %BR% -- TWiki:Main.MikeMannix - 12 May 2002