---## TWiki Variables ---+++ Predefined Variables %WIKITOOLNAME% expands the following variables enclosed in % percent signs: <table border="1"><tr> <th> Variable: </th><th> Expanded to: </th> </tr><tr> <td> =%<nop>WIKIHOMEURL%= </td> <td> The base script URL of %WIKITOOLNAME%, is the link of the Home icon in the upper left corner, is <b>%WIKIHOMEURL%</b> </td> </tr><tr> <td> =%<nop>SCRIPTURL%= </td> <td> The script URL of %WIKITOOLNAME%, is <b>%SCRIPTURL%</b></td> </tr><tr> <td> =%<nop>SCRIPTURLPATH%= </td> <td> The path of the script URL of %WIKITOOLNAME%, is <b>%SCRIPTURLPATH%</b></td> </tr><tr> <td> =%<nop>SCRIPTSUFFIX%= </td> <td> The script suffix, i.e. =.pl=, is <b>%SCRIPTSUFFIX%</b></td> </tr><tr> <td> =%<nop>PUBURL%= </td> <td> The public URL of TWiki, is <b>%PUBURL%</b> </td> </tr><tr> <td> =%<nop>PUBURLPATH%= </td> <td> The path of the public URL of %WIKITOOLNAME%, is <b>%PUBURLPATH%</b> </td> </tr><tr> <td> =%<nop>ATTACHURL%= </td> <td> The attachment URL of the current topic, is <b>%ATTACHURL%</b> <br> Example: If you attach a file you can refer to it as =<b>%<nop>ATTACHURL%/image.gif</b>= </td> </tr><tr> <td> =%<nop>ATTACHURLPATH%= </td> <td> The path of the attachment URL of the current topic, is <b>%ATTACHURLPATH%</b> </td> </tr><tr> <td> =%<nop>URLPARAM{"name"}%= </td> <td> Returns the value of a URL parameter. I.e. =%<nop>URLPARAM{"skin"}%= returns <b>print</b> for a =.../view/%WEB%/%TOPIC%?skin=print= URL. Is <b>%URLPARAM{"skin"}%</b> </td> </tr><tr> <td> =%<nop>WIKITOOLNAME%= </td> <td> Name of wiki tool, is <b>%WIKITOOLNAME%</b> </td> </tr><tr> <td> =%<nop>WIKIVERSION%= </td> <td> Wiki tool version, is <b>%WIKIVERSION%</b> </td> </tr><tr> <td> =%<nop>USERNAME%= </td> <td> Your login username, is <b>%USERNAME%</b> </td> </tr><tr> <td> =%<nop>WIKIUSERNAME%= </td> <td> Your Wiki username, if defined in %MAINWEB%.%WIKIUSERSTOPIC%. Same as %<nop>USERNAME% if not defined. Is <b>%WIKIUSERNAME%</b> </td> </tr><tr> <td> =%<nop>WEB%= </td> <td> The current web, is <b>%WEB%</b> </td> </tr><tr> <td> =%<nop>BASEWEB%= </td> <td> The web name where the includes started, e.g. the web of the first topic of nested includes. Same as =%<nop>WEB%= in case there is no include. </td> </tr><tr> <td> =%<nop>INCLUDINGWEB%= </td> <td> The web name of the topic that includes the current topic. Same as =%<nop>WEB%= in case there is no include. </td> </tr><tr> <td> =%<nop>TOPIC%= </td> <td> The current topic name, is <b>%TOPIC%</b> </td> </tr><tr> <td> =%<nop>BASETOPIC%= </td> <td> The name of the topic where the includes started, e.g. the first topic of nested includes. Same as =%<nop>TOPIC%= in case there is no include. </td> </tr><tr> <td> =%<nop>INCLUDINGTOPIC%= </td> <td> The name of the topic that includes the current topic. Same as =%<nop>TOPIC%= in case there is no include. </td> </tr><tr> <td> =%<nop>SPACEDTOPIC%= </td> <td> The current topic name with added spaces, for regular expression search of Ref-By, is <b>%SPACEDTOPIC%</b> </td> </tr><tr> <td> =%<nop>GMTIME%= </td> <td> GM time, is <b>%GMTIME%</b> </td> </tr><tr> <td> =%<nop>GMTIME{"format"}%= </td> <td> Formatted GM time based on time variables. | *Variable:* | *Unit:* | *Example* | | $seconds | seconds | 59 | | $minutes | minutes | 59 | | $hours | hours | 23 | | $day | day of month | 31 | | $month | month in ISO format | Dec | | $mo | 2 digit month | 12 | | $year | 4 digit year | 1999 | | $ye | 2 digit year | 99 | Variables can be shortened to 3 characters. Example: <br> =%<nop>GMTIME{"$day $month, $year - $hour:$min:$sec"}%= is <br> <b>%GMTIME{"$day $month, $year - $hour:$min:$sec"}%</b> </td> </tr><tr> <td> =%<nop>SERVERTIME%= </td> <td> Server time, is <b>%SERVERTIME%</b> </td> </tr><tr> <td> =%<nop>SERVERTIME{"format"}%= </td> <td> Formatted server time. <br> Example: =%<nop>SERVERTIME{"$hou:$min"}%= is <b>%SERVERTIME{"$hou:$min"}%</b> </td> </tr><tr> <td> =%<nop>HTTP_HOST%= </td> <td> HTTP_HOST environment variable, is <b>%HTTP_HOST%</b> </td> </tr><tr> <td> =%<nop>REMOTE_ADDR%= </td> <td> REMOTE_ADDR environment variable, is <b>%REMOTE_ADDR%</b> </td> </tr><tr> <td> =%<nop>REMOTE_PORT%= </td> <td> REMOTE_PORT environment variable, is <b>%REMOTE_PORT%</b> </td> </tr><tr> <td> =%<nop>REMOTE_USER%= </td> <td> REMOTE_USER environment variable, is <b>%REMOTE_USER%</b> </td> </tr><tr> <td> =%<nop>INCLUDE{"SomeTopic"}%= </td> <td> Server side include, includes another topic. The current Wiki web is searched by default. Example: =<b>%<nop>INCLUDE{"%TWIKIWEB%.TWikiWebsTable"}%</b>= </td> </tr><tr> <td> =%<nop>STARTINCLUDE%= </td> <td> If present in included topic, start to include text from this location up to the end, or up to the location of the =%<nop>STOPINCLUDE%= variable. A normal view of the topic shows everyting exept the =%<nop>STARTINCLUDE%= variable itself. </td> </tr><tr> <td> =%<nop>STOPINCLUDE%= </td> <td> If present in included topic, stop to include text at this location and ignore the remaining text. A normal view of the topic shows everyting exept the =%<nop>STOPINCLUDE%= variable itself. </td> </tr><tr> <td> =%<nop>TOC%= </td> <td> Table of Content of current topic. </td> </tr><tr> <td> =%<nop>TOC{"SomeTopic" ...}%= </td> <td> Table of Content. 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. Parameter is composed of the topic name, followed by optional =name="value"= pairs: | *Pair:* | *Description:* | *Default:* | | =web="Name"= | Name of web | Current web | | =depth="2"= | Limit depth of headings shown in TOC | 6 | Examples: =<b>%<nop>TOC{depth="2"}%</b>=, =<b>%<nop>TOC{"TWikiDocumentation" web="%TWIKIWEB%"}%</b>= </tr><tr> <td> =%<nop>SEARCH{"str" ...}%= </td> <td> Inline search, shows a search result embedded in a topic. Parameter is composed of the search term (enclosed in double quotes), followed by optional =name="value"= pairs: [1] | *Pair:* | *Description:* | *Default:* | | =search="food"= | Search term, (either regex or literal, depending on the =regex= parameter) | (used if initial search term is missing) | | =web="Name"= <br> =web="%MAINWEB% Know"= <br> =web="all"= | Wiki web to search: A web, a list of webs separated by whitespace, or all webs =[2]= | Current web | | =scope="topic"= <br> =scope="text"= | Search topic name (title) or in the text (body) of the topic | Topic text (body) | | =order="topic"= <br> =order="modified"= <br> =order="editby"= | Sort the results of search by the topic names, last modified time, or last editor | Sort by topic name | | =limit="all"= <br> =limit="16"= | Limit the number of results returned | All results | | =regex="on"= | RegularExpression search | Literal search | | =reverse="on"= | Reverse the direction of the search | Ascending search | | =casesensitive="on"= | Case sensitive search | Ignore case | | =nosummary="on"= | Show topic title only | Show topic summary | | =bookview="on"= | BookView search, e.g. show complete topic text | Show topic summary | | =nosearch="on"= | Suppress search string | Show search string | | =noheader="on"= | Suppress search header <br> <span style='background: #FFB0B0;'> *Topics: Changed: By:* </span> | Show search header | | =nototal="on"= | Do not show number of topics found | Show number | Example: =<b>%<nop>SEARCH{"wiki" web="%MAINWEB%" scope="topic"}%</b>= </td> </tr><tr> <td> =%<nop>VAR{"NAME" web="Web"}%= </td> <td> Get a preference value from a web other then the current one. Example: To get =%<nop>WEBBGCOLOR%= of the %MAINWEB% web write =%<nop>VAR{"WEBBGCOLOR" web="%MAINWEB%"}%=, is =<b>%VAR{"WEBBGCOLOR" web="%MAINWEB%"}%</b>= </td> </tr></table> [1] __Note__: The search form uses identical names for input fields. [2] __Note__: A web can be excluded from a =web="all"= search if you define a =NOSEARCHALL=on= variable in its %WEBPREFSTOPIC%. ---+++ Preferences Variables Additional variables are defined in the preferences ( site-level ( __SL__ ) in %TWIKIWEB%.%WIKIPREFSTOPIC%, web-level ( __WL__ ) in %WEBPREFSTOPIC% of each web, and user level ( __UL__ ) preferences in individual user topics): <table border="1"><tr> <th> Variable: </th><th> Level: </th><th> What: </th> </tr><tr> <td> =%<nop>WIKIWEBMASTER%= </td> <td> __SL__ </td> <td> Webmaster email address (sender of email notifications) , is <b>%WIKIWEBMASTER%</b> </td> </tr><tr> <td> =%<nop>WIKIWEBLIST%= </td> <td> __SL__ </td> <td> List of %WIKITOOLNAME% webs (in upper right corner of topics) </td> </tr><tr> <td> =%<nop>WEBTOPICLIST%= </td> <td> __WL__ </td> <td> Common links of web (second line of topics) </td> </tr><tr> <td> =%<nop>WEBCOPYRIGHT%= </td> <td> __SL__ , __WL__ </td> <td> Copyright notice (bottom right corner of topics) </td> </tr><tr> <td> =%<nop>WEBBGCOLOR%= </td> <td> __WL__ </td> <td> Background color of web </td> </tr><tr> <td> =%<nop>NOSEARCHALL%= </td> <td> __WL__ </td> <td> Exclude web from a =web="all"= search (set variable to =on= for hidden webs) </td> </tr><tr> <td> =%<nop>NEWTOPICBGCOLOR%= </td> <td> __SL__ , _UL_ </td> <td> Background color of non existing topic. ( __UL__ needs authentication for topic views ) </td> </tr><tr> <td> =%<nop>NEWTOPICFONTCOLOR%= </td> <td> __SL__ , _UL_ </td> <td> Font color of non existing topic. ( __UL__ needs authentication for topic views ) </td> </tr><tr> <td> =%<nop>EDITBOXWIDTH%= </td> <td> __SL__ , __UL__ </td> <td> Horizontal size of edit box, is <b> =%EDITBOXWIDTH%= </b> </td> </tr><tr> <td> =%<nop>EDITBOXHEIGHT%= </td> <td> __SL__ , __UL__ </td> <td> Vertical size of edit box, is <b> =%EDITBOXHEIGHT%= </b> </td> </tr><tr> <td> =%<nop>ATTACHLINKBOX%= </td> <td> __SL__ , __UL__ </td> <td> Default state of the link check box in the attach file page. Check box is initially checked if value is set to =CHECKED= , unchecked if empty. If checked, a link is created to the attached file at the end of the topic. Value is: <b><code>%ATTACHLINKBOX%</code></b> </td> </tr><tr> <td> =%<nop>HTTP_EQUIV_ON_VIEW%= </td> <td> __SL__ </td> <td> http-equiv meta tags for view, rdiff, attach, search* scripts. </td> </tr><tr> <td> =%<nop>HTTP_EQUIV_ON_EDIT%= </td> <td> __SL__ , __UL__ </td> <td> http-equiv meta tags for edit script. </td> </tr><tr> <td> =%<nop>HTTP_EQUIV_ON_PREVIEW%= </td> <td> __SL__ , __UL__ </td> <td> http-equiv meta tags for preview script. </td> </tr><tr> <td> =%<nop>DENYWEBCHANGE%= </td> <td> __WL__ </td> <td> List of users and groups who are *not allowed* to change topics in the %WIKITOOLNAME% web. (More in TWikiAccessControl) </td> </tr><tr> <td> =%<nop>ALLOWWEBCHANGE%= </td> <td> __WL__ </td> <td> List of users and groups who are *allowed* to change topics in the %WIKITOOLNAME% web. (More in TWikiAccessControl) </td> </tr><tr> <td> =%<nop>DENYTOPICCHANGE%= </td> <td> __(any topic)__ </td> <td> List of users and groups who are *not allowed* to change the current topic. (More in TWikiAccessControl) </td> </tr><tr> <td> =%<nop>ALLOWTOPICCHANGE%= </td> <td> __(any topic)__ </td> <td> List of users and groups who are *allowed* to change the current topic. (More in TWikiAccessControl) </td> </tr><tr> <td> =%<nop>FINALPREFERENCES%= </td> <td> __SL__ , __WL__ </td> <td> List of preferences that are not allowed to be overridden by next level preferences</td> </tr></table> __Notes:__ * Preferences variables ( on site-level, web-level and user level ) are defined by bullet lines with this syntax: * =<nop>Set VARIABLENAME = value= * Additional preferences variables can be defined on all three level as needed. Example: * =<nop>Set MYLOGO = %<nop>PUBURLPATH%/%<nop>MAINWEB%/LogoTopic/logo.gif= -- PeterThoeny - 24 Mar 2001 <br>
This topic: TWiki
>
TWikiVariables
Topic revision: r23 - 2001-06-01 - PeterThoeny
Copyright © 1999-2024 by the contributing authors. All material from TWiki is the property of the contributing authors.
Questions, comments, or concerns?
Contact GNHLUG
.
All use of this site subject to our
Legal Notice
(includes Terms of Service).