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></li>
5         <li><a href="#Preferences Variables"> Preferences Variables</a></li>
6         <li><a href="#Setting Preferences"> Setting Preferences</a></li>
7         <li><a href="#Creating Custom Variables"> Creating Custom Variables</a></li>
8       </ul>
9     </li>
10   </ul>
11 </div>
12
13 # <a name="TWiki Variables"></a> TWiki Variables
14
15 _Special text strings expand on the fly to display user data or system info_
16
17 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.
18
19 ## <a name="Predefined Variables"></a> Predefined Variables
20
21 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.
22
23 - %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>.
24
25 This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - expands the following variables (enclosed in <code>**%**</code> percent signs):
26
27 <table align="center" border="1" cellpadding="2" cellspacing="0" style="background-color: #f5f5f5" width="90%">
28   <tr>
29     <th width="160"> Variable: </th>
30     <th> Expanded to: </th>
31   </tr>
32   <tr>
33     <td><code>%WIKIHOMEURL%</code></td>
34     <td> The base script URL of %WIKITOOLNAME%, is the link of the Home icon in the upper left corner, is <b>%WIKIHOMEURL%</b></td>
35   </tr>
36   <tr>
37     <td><code>%SCRIPTURL%</code></td>
38     <td> The script URL of %WIKITOOLNAME%, is <b>http://www.dementia.org/twiki/</b></td>
39   </tr>
40   <tr>
41     <td><code>%SCRIPTURLPATH%</code></td>
42     <td> The path of the script URL of %WIKITOOLNAME%, is <b>http://www.dementia.org/twiki/</b></td>
43   </tr>
44   <tr>
45     <td><code>%SCRIPTSUFFIX%</code></td>
46     <td> The script suffix, ex: <code>.pl</code>, <code>.cgi</code> is <b></b></td>
47   </tr>
48   <tr>
49     <td><code>%PUBURL%</code></td>
50     <td> The public URL of TWiki, is <b>http://www.dementia.org/twiki//view</b><br /> Example: You can refer to a file attached to another topic as <code><b>%PUBURL%/%WEB%/OtherTopic/image.gif</b></code></td>
51   </tr>
52   <tr>
53     <td><code>%PUBURLPATH%</code></td>
54     <td> The path of the public URL of %WIKITOOLNAME%, is <b>http://www.dementia.org/twiki//view</b></td>
55   </tr>
56   <tr>
57     <td><code>%ATTACHURL%</code></td>
58     <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>
59   </tr>
60   <tr>
61     <td><code>%ATTACHURLPATH%</code></td>
62     <td> The path of the attachment URL of the current topic, is <b>http://www.dementia.org/twiki//view</b></td>
63   </tr>
64   <tr>
65     <td><code>%URLPARAM{"name"}%</code></td>
66     <td> Returns the value of a URL parameter. Note that there is a low risk that this variable could be misused for cross-scripting. Ex: <code>%URLPARAM{"skin"}%</code> returns <b>print</b> for a <code>.../view/%WEB%/%TOPIC%?skin=print</code> URL. Is <b></b></td>
67   </tr>
68   <tr>
69     <td><code>%URLENCODE{"string"}%</code></td>
70     <td> Encodes a string for use as a URL parameter. Ex: <code>%URLENCODE{"spaced name"}%</code> returns <b>spaced%20name</b></td>
71   </tr>
72   <tr>
73     <td><code>%WIKITOOLNAME%</code></td>
74     <td> The name of your TWiki site - <b>%WIKITOOLNAME%</b></td>
75   </tr>
76   <tr>
77     <td><code>%WIKIVERSION%</code></td>
78     <td> Your current TWiki version - <b>TWiki-4.1.2, Sat, 03 Mar 2007, build 13046</b></td>
79   </tr>
80   <tr>
81     <td><code>%USERNAME%</code></td>
82     <td> Your login username - <b>admin</b></td>
83   </tr>
84   <tr>
85     <td><code>%WIKINAME%</code></td>
86     <td> Your Wiki username. Same as %USERNAME% if not defined in the [[Main/TWikiUsers]] topic. Is <b>admin</b></td>
87   </tr>
88   <tr>
89     <td><code>%WIKIUSERNAME%</code></td>
90     <td> Your %WIKINAME% including the Main web name - always use full signatures - <b>Main.admin</b></td>
91   </tr>
92   <tr>
93     <td><code>%MAINWEB%</code></td>
94     <td> The web containing [[Main/TWikiUsers]], [[Main/OfficeLocations]] and [[Main/TWikiGroups]] is <b>Main</b></td>
95   </tr>
96   <tr>
97     <td><code>%TWIKIWEB%</code></td>
98     <td> The web containing all documentation and site-wide preference settings for %WIKITOOLNAME% - <b>TWiki</b></td>
99   </tr>
100   <tr>
101     <td><code>%WEB%</code></td>
102     <td> The current web is <b>%WEB%</b></td>
103   </tr>
104   <tr>
105     <td><code>%BASEWEB%</code></td>
106     <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>
107   </tr>
108   <tr>
109     <td><code>%INCLUDINGWEB%</code></td>
110     <td> The web name of the topic that includes the current topic - same as <code>%WEB%</code> if there is no INCLUDE. </td>
111   </tr>
112   <tr>
113     <td><code>%HOMETOPIC%</code></td>
114     <td> The home topic in each web - <b>[[Main/WebHome]]</b></td>
115   </tr>
116   <tr>
117     <td><code>%NOTIFYTOPIC%</code></td>
118     <td> The notify topic in each web - <b>[[Main/WebNotify]]</b></td>
119   </tr>
120   <tr>
121     <td><code>%WIKIUSERSTOPIC%</code></td>
122     <td> The index topic of all registered users - <b>TWikiUsers</b></td>
123   </tr>
124   <tr>
125     <td><code>%WIKIPREFSTOPIC%</code></td>
126     <td> The site-wide preferences topic - <b>TWikiPreferences</b></td>
127   </tr>
128   <tr>
129     <td><code>%WEBPREFSTOPIC%</code></td>
130     <td> The local web preferences topic in each web - <b>WebPreferences</b></td>
131   </tr>
132   <tr>
133     <td><code>%STATISTICSTOPIC%</code></td>
134     <td> The web statistics topic <b>WebStatistics</b></td>
135   </tr>
136   <tr>
137     <td><code>%TOPIC%</code></td>
138     <td> The current topic name - <b>%TOPIC%</b></td>
139   </tr>
140   <tr>
141     <td><code>%BASETOPIC%</code></td>
142     <td> The name of the topic where a single or nested INCLUDE started - same as <code>%TOPIC%</code> if there is no INCLUDE. </td>
143   </tr>
144   <tr>
145     <td><code>%INCLUDINGTOPIC%</code></td>
146     <td> The name of the topic that includes the current topic. Same as <code>%TOPIC%</code> in case there is no include. </td>
147   </tr>
148   <tr>
149     <td><code>%SPACEDTOPIC%</code></td>
150     <td> The current topic name with added spaces, for regular expression search of Ref-By, is <b></b></td>
151   </tr>
152   <tr>
153     <td><code>%TOPICLIST{"format"}%</code></td>
154     <td> Topic index of a web. The "format" defines the format of one topic item. It may include variables: The <code>$name</code> variable gets expanded to the topic name; the <code>$web</code> variable gets expanded to the name of the web. Parameters are format, separator and web: <table border="1" cellpadding="0" cellspacing="0">
155         <tr>
156           <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
157           <th bgcolor="#99CCCC"><strong> Description: </strong></th>
158           <th bgcolor="#99CCCC"><strong> Default: </strong></th>
159         </tr>
160         <tr>
161           <td><code>"format"</code></td>
162           <td> Format of one line, may include <code>$name</code> and <code>$web</code> variables </td>
163           <td><code>"$name"</code></td>
164         </tr>
165         <tr>
166           <td><code>format="format"</code></td>
167           <td> (Alternative to above) </td>
168           <td><code>"$name"</code></td>
169         </tr>
170         <tr>
171           <td><code>separator=", "</code></td>
172           <td> line separator </td>
173           <td><code>"\n"</code> (new line) </td>
174         </tr>
175         <tr>
176           <td><code>web="Name"</code></td>
177           <td> Name of web </td>
178           <td> Current web </td>
179         </tr>
180       </table> Examples: <br /><code>%TOPICLIST{"   * $web.$name"}%</code> creates a bullet list of all topics. <br /><code>%TOPICLIST{separator=", "}%</code> creates a comma separated list of all topics. <br /><code>%TOPICLIST{" &lt;option&gt;$name&lt;/option&gt;"}%</code> creates an option list (for drop down menus). </td>
181   </tr>
182   <tr>
183     <td><code>%WEBLIST{"format"}%</code></td>
184     <td> Web index, ex: list of all webs. Hidden webs are excluded, e.g. webs with a <code>NOSEARCHALL=on</code> preference variable. The <code>"format"</code> defines the format of one web item. The <code>$name</code> variable gets expanded to the name of the web, <code>$qname</code> gets expanded to double quoted name, <code>$marker</code> to <code>marker</code> where web matches <code>selection</code>. Parameters are format, separator and web: <table border="1" cellpadding="0" cellspacing="0">
185         <tr>
186           <th bgcolor="#99CCCC"><strong> Parameter: </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>"format"</code></td>
192           <td> Format of one line, may include <code>$name</code> variable </td>
193           <td><code>"$name"</code></td>
194         </tr>
195         <tr>
196           <td><code>format="format"</code></td>
197           <td> (Alternative to above) </td>
198           <td><code>"$name"</code></td>
199         </tr>
200         <tr>
201           <td><code>separator=", "</code></td>
202           <td> line separator </td>
203           <td><code>"\n"</code> (new line) </td>
204         </tr>
205         <tr>
206           <td><code>webs="public"</code></td>
207           <td> comma sep list of Web, public expands to all non-hidden </td>
208           <td><code>"public"</code></td>
209         </tr>
210         <tr>
211           <td><code>marker="selected"</code></td>
212           <td> Text for <code>$marker</code> where item matches <code>selection</code>, otherwise equals <code>""</code></td>
213           <td><code>"selected"</code></td>
214         </tr>
215         <tr>
216           <td><code>selection="%WEB%"</code></td>
217           <td> Current value to be selected in list </td>
218           <td><code>section="%WEB%"</code></td>
219         </tr>
220       </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>
221   </tr>
222   <tr>
223     <td><code>%GMTIME%</code></td>
224     <td> GM time, is <b>29 Jun 2010 - 15:40</b></td>
225   </tr>
226   <tr>
227     <td><code>%GMTIME{"format"}%</code></td>
228     <td> Formatted GM time based on time variables. <table border="1" cellpadding="0" cellspacing="0">
229         <tr>
230           <th bgcolor="#99CCCC"><strong> Variable: </strong></th>
231           <th bgcolor="#99CCCC"><strong> Unit: </strong></th>
232           <th bgcolor="#99CCCC"><strong> Example </strong></th>
233         </tr>
234         <tr>
235           <td> $seconds </td>
236           <td> seconds </td>
237           <td> 59 </td>
238         </tr>
239         <tr>
240           <td> $minutes </td>
241           <td> minutes </td>
242           <td> 59 </td>
243         </tr>
244         <tr>
245           <td> $hours </td>
246           <td> hours </td>
247           <td> 23 </td>
248         </tr>
249         <tr>
250           <td> $day </td>
251           <td> day of month </td>
252           <td> 31 </td>
253         </tr>
254         <tr>
255           <td> $month </td>
256           <td> month in ISO format </td>
257           <td> Dec </td>
258         </tr>
259         <tr>
260           <td> $mo </td>
261           <td> 2 digit month </td>
262           <td> 12 </td>
263         </tr>
264         <tr>
265           <td> $year </td>
266           <td> 4 digit year </td>
267           <td> 1999 </td>
268         </tr>
269         <tr>
270           <td> $ye </td>
271           <td> 2 digit year </td>
272           <td> 99 </td>
273         </tr>
274       </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:40:25</b></td>
275   </tr>
276   <tr>
277     <td><code>%SERVERTIME%</code></td>
278     <td> Server time, is <b>29 Jun 2010 - 11:40</b></td>
279   </tr>
280   <tr>
281     <td><code>%SERVERTIME{"format"}%</code></td>
282     <td> Formatted server time. <br /> Example: <code>%SERVERTIME{"$hou:$min"}%</code> is <b>11:40</b></td>
283   </tr>
284   <tr>
285     <td><code>%HTTP_HOST%</code></td>
286     <td> HTTP_HOST environment variable, is <b></b></td>
287   </tr>
288   <tr>
289     <td><code>%REMOTE_ADDR%</code></td>
290     <td> REMOTE_ADDR environment variable, is <b></b></td>
291   </tr>
292   <tr>
293     <td><code>%REMOTE_PORT%</code></td>
294     <td> REMOTE_PORT environment variable, is <b></b></td>
295   </tr>
296   <tr>
297     <td><code>%REMOTE_USER%</code></td>
298     <td> REMOTE_USER environment variable, is <b></b></td>
299   </tr>
300   <tr>
301     <td><code>%INCLUDE{"page" ...}%</code></td>
302     <td> Server side include to [[Main/IncludeTopicsAndWebPages]]: <table border="1" cellpadding="0" cellspacing="0">
303         <tr>
304           <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
305           <th bgcolor="#99CCCC"><strong> Description: </strong></th>
306           <th bgcolor="#99CCCC"><strong> Default: </strong></th>
307         </tr>
308         <tr>
309           <td><code>"SomeTopic"</code></td>
310           <td> The name of a topic located in the current web, i.e. <code>%INCLUDE{"WebNotify"}%</code></td>
311           <td>   </td>
312         </tr>
313         <tr>
314           <td><code>"Web.Topic"</code></td>
315           <td> A topic in another web, i.e. <code>%INCLUDE{"TWiki.SiteMap"}%</code></td>
316           <td>   </td>
317         </tr>
318         <tr>
319           <td><code>"http://..."</code></td>
320           <td> A full qualified URL, i.e. <code>%INCLUDE{"http://twiki.org/"}%</code></td>
321           <td>   </td>
322         </tr>
323         <tr>
324           <td><code>pattern="..."</code></td>
325           <td> A [[Main/RegularExpression]] pattern to include a subset of a topic or page </td>
326           <td> none </td>
327         </tr>
328         <tr>
329           <td><code>rev="1.2"</code></td>
330           <td> Include a previous topic revision; N/A for URLs </td>
331           <td> top revision </td>
332         </tr>
333       </table>
334     </td>
335   </tr>
336   <tr>
337     <td><code>%STARTINCLUDE%</code></td>
338     <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>
339   </tr>
340   <tr>
341     <td><code>%STOPINCLUDE%</code></td>
342     <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>
343   </tr>
344   <tr>
345     <td><code>%TOC%</code></td>
346     <td> Table of Contents of current topic. </td>
347   </tr>
348   <tr>
349     <td><code>%TOC{"SomeTopic" ...}%</code></td>
350     <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">
351         <tr>
352           <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
353           <th bgcolor="#99CCCC"><strong> Description: </strong></th>
354           <th bgcolor="#99CCCC"><strong> Default: </strong></th>
355         </tr>
356         <tr>
357           <td><code>"TopicName"</code></td>
358           <td> topic name </td>
359           <td> Current topic </td>
360         </tr>
361         <tr>
362           <td><code>web="Name"</code></td>
363           <td> Name of web </td>
364           <td> Current web </td>
365         </tr>
366         <tr>
367           <td><code>depth="2"</code></td>
368           <td> Limit depth of headings shown in TOC </td>
369           <td> 6 </td>
370         </tr>
371       </table> Examples: <code><b>%TOC{depth="2"}%</b></code>, <code><b>%TOC{"TWikiDocumentation" web="TWiki"}%</b></code></td>
372   </tr>
373   <tr>
374     <td><code>%SEARCH{"text" ...}%</code></td>
375     <td> Inline search, shows a search result embedded in a topic. Parameters are the search term, web, scope, order and many more: [1] <table border="1" cellpadding="0" cellspacing="0">
376         <tr>
377           <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
378           <th bgcolor="#99CCCC"><strong> Description: </strong></th>
379           <th bgcolor="#99CCCC"><strong> Default: </strong></th>
380         </tr>
381         <tr>
382           <td><code>"text"</code></td>
383           <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>
384           <td> required </td>
385         </tr>
386         <tr>
387           <td><code>search="text"</code></td>
388           <td> (Alternative to above) </td>
389           <td> N/A </td>
390         </tr>
391         <tr>
392           <td><code>web="Name"</code><br /><code>web="Main Know"</code><br /><code>web="all"</code></td>
393           <td> Wiki web to search: A web, a list of webs separated by whitespace, or <code>all</code> webs. [2] </td>
394           <td> Current web </td>
395         </tr>
396         <tr>
397           <td><code>scope="topic"</code><br /><code>scope="text"</code></td>
398           <td> Search topic name (title) or in the text (body) of the topic </td>
399           <td> Topic text (body) </td>
400         </tr>
401         <tr>
402           <td><code>order="topic"</code><br /><code>order="modified"</code><br /><code>order="editby"</code><br /><code>order=<br /> "formfield(name)"</code></td>
403           <td> Sort the results of search by the topic names, last modified time, last editor, or named field of [[Main/TWikiForms]]</td>
404           <td> Sort by topic name </td>
405         </tr>
406         <tr>
407           <td><code>limit="all"</code><br /><code>limit="16"</code></td>
408           <td> Limit the number of results returned </td>
409           <td> All results </td>
410         </tr>
411         <tr>
412           <td><code>regex="on"</code></td>
413           <td>[[Main/RegularExpression]] search; also enables ";" as <em>and</em></td>
414           <td> Literal search </td>
415         </tr>
416         <tr>
417           <td><code>reverse="on"</code></td>
418           <td> Reverse the direction of the search </td>
419           <td> Ascending search </td>
420         </tr>
421         <tr>
422           <td><code>casesensitive="on"</code></td>
423           <td> Case sensitive search </td>
424           <td> Ignore case </td>
425         </tr>
426         <tr>
427           <td><code>nosummary="on"</code></td>
428           <td> Show topic title only </td>
429           <td> Show topic summary </td>
430         </tr>
431         <tr>
432           <td><code>bookview="on"</code></td>
433           <td>[[Main/BookView]] search, e.g. show complete topic text </td>
434           <td> Show topic summary </td>
435         </tr>
436         <tr>
437           <td><code>nosearch="on"</code></td>
438           <td> Suppress search string </td>
439           <td> Show search string </td>
440         </tr>
441         <tr>
442           <td><code>noheader="on"</code></td>
443           <td> Suppress search header <br /><span style="background: #FFB0B0"> <strong>Topics: Changed: By:</strong> </span></td>
444           <td> Show search header </td>
445         </tr>
446         <tr>
447           <td><code>nototal="on"</code></td>
448           <td> Do not show number of topics found </td>
449           <td> Show number </td>
450         </tr>
451         <tr>
452           <td><code>header="..."</code><br /><code>format="..."</code></td>
453           <td> Custom format results: see <strong>[[Main/FormattedSearch]]</strong> for usage, variables &amp; examples </td>
454           <td> Results in table </td>
455         </tr>
456       </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>
457   </tr>
458   <tr>
459     <td><code>%METASEARCH{...}%</code></td>
460     <td> Special search of meta data <table border="1" cellpadding="0" cellspacing="0">
461         <tr>
462           <th bgcolor="#99CCCC"><strong> Parameter: </strong></th>
463           <th bgcolor="#99CCCC"><strong> Description: </strong></th>
464           <th bgcolor="#99CCCC"><strong> Default: </strong></th>
465         </tr>
466         <tr>
467           <td><code>type="topicmoved"</code></td>
468           <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>
469           <td> required </td>
470         </tr>
471         <tr>
472           <td><code>web="%WEB%"</code></td>
473           <td> Wiki web to search: A web, a list of webs separated by whitespace, or <code>all</code> webs. </td>
474           <td> required </td>
475         </tr>
476         <tr>
477           <td><code>topic="%TOPIC%"</code></td>
478           <td> The topic the search relates to </td>
479           <td> required </td>
480         </tr>
481         <tr>
482           <td><code>title="Title"</code></td>
483           <td> Text that is prepended to any search results </td>
484           <td> required </td>
485         </tr>
486       </table> Example: <code><b>%METASEARCH{type="topicmoved" web="%WEB%" topic="%TOPIC%" title="This topic used to exist and was moved to: "}%</b></code>, you may want to use this in [[Main/WebTopicViewTemplate]] and [[Main/WebTopicNonWikiTemplate]]<br /><code><b>%METASEARCH{type="parent" web="%WEB%" topic="%TOPIC%" title="Children: "}%</b></code></td>
487   </tr>
488   <tr>
489     <td><code>%VAR{"NAME" web="Web"}%</code></td>
490     <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>
491   </tr>
492 </table>
493
494 > [1]
495 >
496 > **_Note_**
497 >
498 > : The search form uses identical names for input fields.
499 >
500 > [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]].
501
502 <a name="PreferencesVariables"></a>
503
504 ## <a name="Preferences Variables"></a> Preferences Variables
505
506 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):
507
508 <table align="center" border="1" cellpadding="2" cellspacing="0" style="background-color: #f5f5f5" width="90%">
509   <tr>
510     <th width="160"> Variable: </th>
511     <th> Level: </th>
512     <th> What: </th>
513   </tr>
514   <tr>
515     <td><code>%WIKIWEBMASTER%</code></td>
516     <td><strong><em>SL</em></strong></td>
517     <td> Webmaster email address (sender of email notifications) , is <b></b></td>
518   </tr>
519   <tr>
520     <td><code>%WIKIWEBLIST%</code></td>
521     <td><strong><em>SL</em></strong></td>
522     <td> List of %WIKITOOLNAME% webs (in upper right corner of topics) </td>
523   </tr>
524   <tr>
525     <td><code>%WEBTOPICLIST%</code></td>
526     <td><strong><em>WL</em></strong></td>
527     <td> Common links of web (second line of topics) </td>
528   </tr>
529   <tr>
530     <td><code>%WEBCOPYRIGHT%</code></td>
531     <td><strong><em>SL</em></strong> , <strong><em>WL</em></strong></td>
532     <td> Copyright notice (bottom right corner of topics) </td>
533   </tr>
534   <tr>
535     <td><code>%WEBBGCOLOR%</code></td>
536     <td><strong><em>WL</em></strong></td>
537     <td> Background color of web </td>
538   </tr>
539   <tr>
540     <td><code>%NOSEARCHALL%</code></td>
541     <td><strong><em>WL</em></strong></td>
542     <td> Exclude web from a <code>web="all"</code> search (set variable to <code>on</code> for hidden webs) </td>
543   </tr>
544   <tr>
545     <td><code>%NEWTOPICBGCOLOR%</code></td>
546     <td><strong><em>SL</em></strong> , <em>UL</em></td>
547     <td> Background color of non existing topic. ( <strong><em>UL</em></strong> needs authentication for topic views ) </td>
548   </tr>
549   <tr>
550     <td><code>%NEWTOPICFONTCOLOR%</code></td>
551     <td><strong><em>SL</em></strong> , <em>UL</em></td>
552     <td> Font color of non existing topic. ( <strong><em>UL</em></strong> needs authentication for topic views ) </td>
553   </tr>
554   <tr>
555     <td><code>%EDITBOXWIDTH%</code></td>
556     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
557     <td> Horizontal size of edit box, is <b> <code>%EDITBOXWIDTH%</code> </b></td>
558   </tr>
559   <tr>
560     <td><code>%EDITBOXHEIGHT%</code></td>
561     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
562     <td> Vertical size of edit box, is <b> <code>%EDITBOXHEIGHT%</code> </b></td>
563   </tr>
564   <tr>
565     <td><code>%EDITBOXSTYLE%</code></td>
566     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
567     <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>
568   </tr>
569   <tr>
570     <td><code>%RELEASEEDITLOCKCHECKBOX%</code></td>
571     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
572     <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>
573   </tr>
574   <tr>
575     <td><code>%DONTNOTIFYCHECKBOX%</code></td>
576     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
577     <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>
578   </tr>
579   <tr>
580     <td><code>%ATTACHLINKBOX%</code></td>
581     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
582     <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>
583   </tr>
584   <tr>
585     <td><code>%HTTP_EQUIV_ON_VIEW%</code></td>
586     <td><strong><em>SL</em></strong></td>
587     <td> http-equiv meta tags for view, rdiff, attach, search* scripts. </td>
588   </tr>
589   <tr>
590     <td><code>%HTTP_EQUIV_ON_EDIT%</code></td>
591     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
592     <td> http-equiv meta tags for edit script. </td>
593   </tr>
594   <tr>
595     <td><code>%HTTP_EQUIV_ON_PREVIEW%</code></td>
596     <td><strong><em>SL</em></strong> , <strong><em>UL</em></strong></td>
597     <td> http-equiv meta tags for preview script. </td>
598   </tr>
599   <tr>
600     <td><code>%DENYWEBCHANGE%</code></td>
601     <td><strong><em>WL</em></strong></td>
602     <td> List of users and groups who are <strong>not allowed</strong> to change topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
603   </tr>
604   <tr>
605     <td><code>%ALLOWWEBCHANGE%</code></td>
606     <td><strong><em>WL</em></strong></td>
607     <td> List of users and groups who are <strong>allowed</strong> to change topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
608   </tr>
609   <tr>
610     <td><code>%DENYTOPICCHANGE%</code></td>
611     <td><strong><em>(any topic)</em></strong></td>
612     <td> List of users and groups who are <strong>not allowed</strong> to change the current topic. (More in [[Main/TWikiAccessControl]]) </td>
613   </tr>
614   <tr>
615     <td><code>%ALLOWTOPICCHANGE%</code></td>
616     <td><strong><em>(any topic)</em></strong></td>
617     <td> List of users and groups who are <strong>allowed</strong> to change the current topic. (More in [[Main/TWikiAccessControl]]) </td>
618   </tr>
619   <tr>
620     <td><code>%DENYWEBRENAME%</code></td>
621     <td><strong><em>WL</em></strong></td>
622     <td> List of users and groups who are <strong>not allowed</strong> to rename topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
623   </tr>
624   <tr>
625     <td><code>%ALLOWWEBRENAME%</code></td>
626     <td><strong><em>WL</em></strong></td>
627     <td> List of users and groups who are <strong>allowed</strong> to rename topics in the %WIKITOOLNAME% web. (More in [[Main/TWikiAccessControl]]) </td>
628   </tr>
629   <tr>
630     <td><code>%DENYTOPICRENAME%</code></td>
631     <td><strong><em>(any topic)</em></strong></td>
632     <td> List of users and groups who are <strong>not allowed</strong> to rename the current topic. (More in [[Main/TWikiAccessControl]]) </td>
633   </tr>
634   <tr>
635     <td><code>%ALLOWTOPICRENAME%</code></td>
636     <td><strong><em>(any topic)</em></strong></td>
637     <td> List of users and groups who are <strong>allowed</strong> to rename the current topic. (More in [[Main/TWikiAccessControl]]) </td>
638   </tr>
639   <tr>
640     <td>
641       <p>
642       </p>
643     </td>
644     <td><code>%FINALPREFERENCES%</code></td>
645     <td><strong><em>SL</em></strong> , <strong><em>WL</em></strong></td>
646     <td> List of preferences that are not allowed to be overridden by next level preferences</td>
647   </tr>
648 </table>
649
650 > **_Note:_**
651 >
652 > There are some more useful variables defined in the
653 >
654 > [[TWikiPreferences]]
655 >
656 > like
657 >
658 > `%BR%`
659 >
660 > for line break, colors like
661 >
662 > `%RED%`
663 >
664 > for colored text and small icons like
665 >
666 > `%H%`
667 >
668 > for a %H% Help icon.
669
670 <a name="SettingPrefs"></a>
671
672 ## <a name="Setting Preferences"></a> Setting Preferences
673
674 - 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:_**
675 - <code>**Set VARIABLENAME = value**</code>
676   - <code>**Set VARIABLENAME = value**</code>
677
678 ## <a name="Creating Custom Variables"></a> Creating Custom Variables
679
680 - 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.
681
682 > **Example: Create a custom logo variable the %WEB% web**
683 >
684 > <br />
685 >
686 > - 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`:
687 >   - <code>**Set MYLOGO = %PUBURL%/TWiki/LogoTopic/mylogo.gif**</code>
688
689 -- [[PeterThoeny]] - 19 Jan 2003 <br /> -- [[MikeMannix]] - 12 May 2002