TWiki
>
TWiki/ Web
>
TWikiVariables
(revision 77) (raw view)
Edit
Attach
%TOC% %STARTINCLUDE% ---# TWiki Variables _Special text strings expand on the fly to display user data or system info_ <nop>TWikiVariables are text strings - =%<nop>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. __Note:__ To leave a variable unexpanded, preceed it with an exclamation point, e.g. type =!%<nop>TOPIC%= to get !%TOPIC%. ---++ Predefined Variables Most predefined variables return values that were either set in the ==lib/twiki.cfg== 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. * %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 ==%<nop>INCLUDINGTOPIC%==, ==%<nop>INCLUDE%==, and the mighty ==%<nop>SEARCH%==. This version of TWiki - %WIKIVERSION% - expands the following variables (enclosed in ==%== percent signs): #VarATTACHURL ---+++ ATTACHURL -- attachment URL of the current topic * Syntax: =%<nop>ATTACHURL%= * Expands to: =%ATTACHURL%= * Example: If you attach a file you can refer to it as =%<nop>ATTACHURL%/image.gif= * Related: [[#VarATTACHURLPATH][ATTACHURLPATH]], [[#VarPUBURLPATH][PUBURLPATH]], [[#VarSCRIPTURL][SCRIPTURL]], FileAttachments #VarATTACHURLPATH ---+++ ATTACHURLPATH -- path of the attachment URL of the current topic * Syntax: =%<nop>ATTACHURLPATH%= * Expands to: =%ATTACHURLPATH%= * Related: [[#VarATTACHURL][ATTACHURL]], [[#VarPUBURL][PUBURL]], FileAttachments #VarBASETOPIC ---+++ BASETOPIC -- base topic where an INCLUDE started * The name of the topic where a single or nested INCLUDE started - same as =%<nop>TOPIC%= if there is no INCLUDE * Syntax: =%<nop>BASETOPIC%= * Related: [[#VarBASEWEB][BASEWEB]], [[#VarINCLUDINGTOPIC][INCLUDINGTOPIC]], [[#VarINCLUDE][INCLUDE]], [[#VarTOPIC][TOPIC]] #VarBASEWEB ---+++ BASEWEB -- base web where an INCLUDE started * 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. * Syntax: =%<nop>BASEWEB%= * Related: [[#VarBASETOPIC][BASETOPIC]], [[#VarINCLUDINGWEB][INCLUDINGWEB]], [[#VarINCLUDE][INCLUDE]], [[#VarWEB][WEB]] #VarDISPLAYTIME ---+++ DISPLAYTIME -- display time * Syntax: =%<nop>DISPLAYTIME%= * Expands to: =%DISPLAYTIME%= * Related: [[#VarDISPLAYTIME2][DISPLAYTIME{"format"}]], [[#VarGMTIME][GMTIME]], [[#VarSERVERTIME][SERVERTIME]] #VarDISPLAYTIME2 ---+++ DISPLAYTIME{"format"} -- formatted display time * Formatted time - either GMT or Local server time, depending on setting in TWiki.cfg. Same format qualifiers as =%<nop>GMTIME%= * Syntax: =%<nop>DISPLAYTIME{"format"}%= * Example: =%<nop>DISPLAYTIME{"$hou:$min"}%= expands to =%DISPLAYTIME{"$hou:$min"}%= * Related: [[#VarDISPLAYTIME][DISPLAYTIME]], [[#VarGMTIME][GMTIME]], [[#VarSERVERTIME][SERVERTIME]] #VarENCODE ---+++ ENCODE{"string"} -- encodes a string * Syntax: =%<nop>ENCODE{"string"}%= * Supported parameters: | *Parameter:* | *Description:* | *Default:* | | ="string"= | String to encode | required (can be empty) | | =type="entity"= | Encode special characters into HTML entities, like a double quote into =&#034;= | URL encoding | | =type="url"= | Encode special characters for URL parameter use, like a double quote into =%22= | (this is the default) | * Example: =%<nop>ENCODE{"spaced name"}%= expands to =%ENCODE{"spaced name"}%= * Related: [[#VarURLPARAM][URLPARAM]] #VarGMTIME ---+++ GMTIME -- GM time * Syntax: =%<nop>GMTIME%= * Expands to: =%GMTIME%= * Related: [[#VarDISPLAYTIME][DISPLAYTIME]], [[#VarGMTIME2][GMTIME{"format"}]], [[#VarSERVERTIME][SERVERTIME]] #VarGMTIME2 ---+++ GMTIME{"format"} -- formatted GM time * Syntax: =%<nop>GMTIME{"format"}%= * Supported variables: | *Variable:* | *Unit:* | *Example* | | =$seconds= | seconds | 59 | | =$minutes= | minutes | 59 | | =$hours= | hours | 23 | | =$day= | day of month | 31 | | =$wday= | day of the Week (Sun, Mon, Tue, Wed, Thu, Fri, Sat) | Thu | | =$month= | month in ISO format | Dec | | =$mo= | 2 digit month | 12 | | =$year= | 4 digit year | 1999 | | =$ye= | 2 digit year | 99 | | =$tz= | either "GMT" (if set to gmtime), or "Local" (if set to servertime) | GMT | | =$iso= | ISO format timestamp | %GMTIME{"$iso"}% | | =$rcs= | RCS format timestamp | %GMTIME{"$rcs"}% | | =$http= | E-mail & http format timestamp | %GMTIME{"$http"}% | * Variables can be shortened to 3 characters * Example: =%<nop>GMTIME{"$day $month, $year - $hour:$min:$sec"}%= expands to =%GMTIME{"$day $month, $year - $hour:$min:$sec"}%= * Related: [[#VarDISPLAYTIME][DISPLAYTIME]], [[#VarGMTIME][GMTIME]], [[#VarSERVERTIME][SERVERTIME]] #VarHOMETOPIC ---+++ HOMETOPIC -- home topic in each web * Syntax: =%<nop>HOMETOPIC%= * Expands to: =%HOMETOPIC%=, renders as [[%HOMETOPIC%]] * Related: [[#VarNOTIFYTOPIC][NOTIFYTOPIC]], [[#VarSTATISTICSTOPIC][STATISTICSTOPIC]], [[#VarTOPIC][TOPIC]] #VarHTTPHOST ---+++ HTTP_HOST -- environment variable * Syntax: =%<nop>HTTP_HOST%= * Expands to: =%HTTP_HOST%= * Related: [[#VarREMOTEADDR][REMOTE_ADDR]], [[#VarREMOTEPORT][REMOTE_PORT]], [[#VarREMOTEUSER][REMOTE_USER]] #VarICON ---+++ ICON{"type"} -- small icon of common attachment types * Small 16x16 pixel icon of common attachment types. Specify file type only, file name, or full path name * Syntax: =%<nop>ICON{"type"}%= * Samples: %ICON{"bmp"}% =bmp=, %ICON{"doc"}% =doc=, %ICON{"gif"}% =gif=, %ICON{"hlp"}% =hlp=, %ICON{"html"}% =html=, %ICON{"mp3"}% =mp3=, %ICON{"pdf"}% =pdf=, %ICON{"ppt"}% =ppt=, %ICON{"txt"}% =txt=, %ICON{"xls"}% =xls=, %ICON{"xml"}% =xml=, %ICON{"zip"}% =zip= * Example: =%<nop>ICON{"pdf"}%= expands to %ICON{"pdf"}% * Related: %WIKIPREFSTOPIC%, FileAttachments, TWikiDocGraphics #VarINCLUDE ---+++ INCLUDE{"page"} -- include other topics or web pages * Syntax: =%<nop>INCLUDE{"page" ...}%= * Supported parameters: | *Parameter:* | *Description:* | *Default:* | | ="SomeTopic"= | The name of a topic located in the current web, i.e. =%<nop>INCLUDE{"WebNotify"}%= | | | ="Web.Topic"= | A topic in another web, i.e. =%<nop>INCLUDE{"%TWIKIWEB%.SiteMap"}%= | | | ="http://..."= | A full qualified URL, i.e. =%<nop>INCLUDE{"http://twiki.org/"}%= | | | =pattern="..."= | A RegularExpression pattern to include a subset of a topic or page | none | | =rev="1.2"= | Include a previous topic revision; N/A for URLs | top revision | | =warn="off"= | Warn if topic include fails: Fail silently (if =off=); output default warning (if set to =on=); else, output specific text (use =$topic= for topic name) | =%INCLUDE- WARNING%= [[TWikiPreferences][preferences]] setting | * Related: [[#VarBASETOPIC][BASETOPIC]], [[#VarBASEWEB][BASEWEB]], [[#VarINCLUDINGTOPIC][INCLUDINGTOPIC]], [[#VarINCLUDINGWEB][INCLUDINGWEB]], IncludeTopicsAndWebPages #VarINCLUDINGTOPIC ---+++ INCLUDINGTOPIC -- name of topic that includes current topic * The name of the topic that includes the current topic - same as =%<nop>TOPIC%= in case there is no include * Syntax: =%<nop>INCLUDINGTOPIC%= * Related: [[#VarBASETOPIC][BASETOPIC]], [[#VarINCLUDINGWEB][INCLUDINGWEB]], [[#VarINCLUDE][INCLUDE]], [[#VarTOPIC][TOPIC]] #VarINCLUDINGWEB ---+++ INCLUDINGWEB -- web that includes current topic * The web name of the topic that includes the current topic - same as =%<nop>WEB%= if there is no INCLUDE. * Syntax: =%<nop>INCLUDINGWEB%= * Related: [[#VarBASEWEB][BASEWEB]], [[#VarINCLUDINGTOPIC][INCLUDINGTOPIC]], [[#VarINCLUDE][INCLUDE]], [[#VarWEB][WEB]] #VarMAINWEB ---+++ MAINWEB -- name of Main web * The web containing %MAINWEB%.%WIKIUSERSTOPIC%, %MAINWEB%.OfficeLocations and %MAINWEB%.TWikiGroups * Syntax: =%<nop>MAINWEB%= * Expands to: =%MAINWEB%= * Related: [[#VarTWIKIWEB][TWIKIWEB]] #VarMETASEARCH ---+++ METASEARCH -- special search of meta data * Syntax: =%<nop>METASEARCH{...}%= * Supported parameters: | *Parameter:* | *Description:* | *Default:* | | =type="topicmoved"= | What sort of search is required? <br /> ="topicmoved"= if search for a topic that may have been moved <br /> ="parent"= if searching for topics that have a specific parent i.e. its children | required | | =web="%<nop>WEB%"= | Wiki web to search: A web, a list of webs separated by whitespace, or =all= webs. | required | | =topic="%<nop>TOPIC%"= | The topic the search relates to | required | | =title="Title"= | Text that is prepended to any search results | required | * Example: =%<nop>METASEARCH{type="topicmoved" web="%<nop>WEB%" topic="%<nop>TOPIC%" title="This topic used to exist and was moved to: "}%= * Example: You may want to use this in WebTopicViewTemplate and WebTopicNonWikiTemplate:<br /> =%<nop>METASEARCH{type="parent" web="%<nop>WEB%" topic="%<nop>TOPIC%" title="Children: "}%= * Related: [[#VarSEARCH][SEARCH]] #VarNOTIFYTOPIC ---+++ NOTIFYTOPIC -- name of the notify topic * Syntax: =%<nop>NOTIFYTOPIC%= * Expands to: =%NOTIFYTOPIC%=, renders as [[%NOTIFYTOPIC%]] * Related: [[#VarHOMETOPIC][HOMETOPIC]], [[#VarSTATISTICSTOPIC][STATISTICSTOPIC]], [[#VarTOPIC][TOPIC]] #VarPUBURL ---+++ PUBURL -- the base URL of attachments * Syntax: =%<nop>PUBURL%= * Expands to: =%PUBURL%= * Example: You can refer to a file attached to another topic with =%<nop>PUBURL%/%<nop>WEB%/OtherTopic/image.gif= * Related: [[#VarATTACHURL][ATTACHURL]], [[#VarPUBURLPATH][PUBURLPATH]], [[#VarSCRIPTURL][SCRIPTURL]], FileAttachments #VarPUBURLPATH ---+++ PUBURLPATH -- the base URL path of attachments * Syntax: =%<nop>PUBURLPATH%= * Expands to: =%PUBURLPATH%= * Related: [[#VarATTACHURL][ATTACHURL]], [[#VarPUBURL][PUBURL]], FileAttachments #VarREMOTEADDR ---+++ REMOTE_ADDR -- environment variable * Syntax: =%<nop>REMOTE_ADDR%= * Expands to: =%REMOTE_ADDR%= * Related: [[#VarHTTPHOST][HTTP_HOST]], [[#VarREMOTEPORT][REMOTE_PORT]], [[#VarREMOTEUSER][REMOTE_USER]] #VarREMOTEPORT ---+++ REMOTE_PORT -- environment variable * Syntax: =%<nop>REMOTE_PORT%= * Expands to: <code>%REMOTE_PORT%</code> * Related: [[#VarHTTPHOST][HTTP_HOST]], [[#VarREMOTEADDR][REMOTE_ADDR]], [[#VarREMOTEUSER][REMOTE_USER]] #VarREMOTEUSER ---+++ REMOTE_USER -- environment variable * Syntax: =%<nop>REMOTE_USER%= * Expands to: <code>%REMOTE_USER%</code> * Related: [[#VarHTTPHOST][HTTP_HOST]], [[#VarREMOTEADDR][REMOTE_ADDR]], [[#VarREMOTEPORT][REMOTE_PORT]], [[#VarUSERNAME][USERNAME]], [[#VarWIKINAME][WIKINAME]], [[#VarWIKIUSERNAME][WIKIUSERNAME]] #VarSCRIPTURL ---+++ SCRIPTURL -- script URL of %WIKITOOLNAME% * Syntax: =%<nop>SCRIPTURL%= * Expands to: =%SCRIPTURL%= * Example: To get the authenticated version of current topic write =%<nop>SCRIPTURL%/viewauth%<nop>SCRIPTSUFFIX%/%<nop>WEB%/%<nop>TOPIC%= which expands to =%SCRIPTURL%/viewauth%SCRIPTSUFFIX%/%WEB%/%TOPIC%= * Related: [[#VarPUBURL][PUBURL]], [[#VarSCRIPTSUFFIX][SCRIPTSUFFIX]], [[#VarSCRIPTURLPATH][SCRIPTURLPATH]] #VarSCRIPTURLPATH ---+++ SCRIPTURLPATH -- script URL path of %WIKITOOLNAME% * Syntax: =%<nop>SCRIPTURLPATH%= * Expands to: =%SCRIPTURLPATH%= * Related: [[#VarPUBURLPATH][PUBURLPATH]], [[#VarSCRIPTURL][SCRIPTURL]] #VarSCRIPTSUFFIX ---+++ SCRIPTSUFFIX -- script suffix * Some %WIKITOOLNAME% installations require a file extension for CGI scripts like =.pl= or =.cgi= * Syntax: =%<nop>SCRIPTSUFFIX%= * Expands to: <code>%SCRIPTSUFFIX%</code> * Related: [[#VarSCRIPTURL][SCRIPTURL]] #VarSEARCH ---+++ SEARCH{"text"} -- search content * Inline search, shows a search result embedded in a topic * Syntax: =%<nop>SEARCH{"text" ...}%= * Supported parameters: [1] | *Parameter:* | *Description:* | *Default:* | | ="text"= | Search term. Is a keyword search, literal search or regular expression search, depending on the =type= parameter. SearchHelp has more | required | | =search="text"= | (Alternative to above) | N/A | | =web="Name"= <br /> =web="%MAINWEB%, Know"= <br /> =web="all"= | Wiki web to search: A web, a list of webs separated by comma, or =all= webs. [2] | Current web | | =topic="%WEBPREFSTOPIC%"= <br /> =topic="*Bug"= | Limit search to topics: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. | All topics in a web | | =excludetopic="Web*"= <br /> =excludetopic="%HOMETOPIC%, <nop>WebChanges"= | Exclude topics from search: A topic, a topic with asterisk wildcards, or a list of topics separated by comma. | None | | =type="keyword"= <br /> =type="literal"= <br /> =type="regex"= | Do a keyword search like =soap "web service" -shampoo=; a literal search like =web service=; or RegularExpression search like =soap;web service;!shampoo= | =%<nop>SEARCHVAR- DEFAULTTYPE%= [[TWikiPreferences][preferences]] setting (%SEARCHVARDEFAULTTYPE%) | | =scope="topic"= <br /> =scope="text"= <br /> =scope="all"= | Search topic name (title); the text (body) of topic; or all (both) | ="text"= | | =order="topic"= <br /> =order="created"= <br /> =order="modified"= <br /> =order="editby"= <br /> =order=<br /> "formfield(name)"= | Sort the results of search by the topic names, topic creation time, last modified time, last editor, or named field of TWikiForms. The sorting is done web by web; in case you want to sort across webs, create a [[FormattedSearch][formatted]] table and sort it with TablePlugin's initsort | Sort by topic name | | =limit="all"= <br /> =limit="16"= | Limit the number of results returned. This is done after sorting in case =order= is specified | All results | | =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 | | =header="..."= <br /> =format="..."= | Custom format results: see *[[FormattedSearch]]* for usage, variables & examples | Results in table | | =expandvariables="on"= | Expand variables before applying a FormattedSearch on a search hit. Useful to show the expanded text, e.g. to show the result of a SpreadSheetPlugin =%<nop>CALC{}%= instead of the formula | Raw text | | =multiple="on"= | Multiple hits per topic. Each hit can be [[FormattedSearch][formatted]]. The last token is used in case of a regular expression ";" _and_ search | Only one hit per topic | | =separator=", "= | Line separator between hits | Newline ="$n"= | * Example: =%<nop>SEARCH{"wiki" web="%MAINWEB%" scope="topic"}%= * Example with format: =%<nop>SEARCH{"FAQ" scope="topic" nosearch="on" nototal="on" header="| *Topic: * | *Summary: * |" format="<nop>| $topic | $summary |"%= _(displays results in a table with header - [[FormattedSearch][details]])_ * %H% If the TWiki:Plugins.TablePlugin is installed, you may set a =%<nop>TABLE{}%= variable just before the =%<nop>SEARCH{}%= to alter the output of a search. Example: =%<nop>TABLE{ tablewidth="90%" }%= * Related: [[#VarMETASEARCH][METASEARCH]], [[#VarTOPICLIST][TOPICLIST]], [[#VarWEBLIST][WEBLIST]], FormattedSearch * [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% #VarSERVERTIME ---+++ SERVERTIME -- server time * Syntax: =%<nop>SERVERTIME%= * Expands to: =%SERVERTIME%= * Related: [[#VarDISPLAYTIME][DISPLAYTIME]], [[#VarGMTIME][GMTIME]], [[#VarSERVERTIME2][SERVERTIME{"format"}]] #VarSERVERTIME2 ---+++ SERVERTIME{"format"} -- formatted server time * Same format qualifiers as =%<nop>GMTIME%= * Syntax: =%<nop>SERVERTIME{"format"}%= * Example: =%<nop>SERVERTIME{"$hou:$min"}%= expands to =%SERVERTIME{"$hou:$min"}%= * Related: [[#VarDISPLAYTIME][DISPLAYTIME]], [[#VarGMTIME][GMTIME]], [[#VarSERVERTIME][SERVERTIME]] #VarSPACEDTOPIC ---+++ SPACEDTOPIC -- topic name, spaced and encoded * The current topic name with added spaces, for regular expression search of Ref-By * Syntax: =%<nop>SPACEDTOPIC%= * Expands to: =%SPACEDTOPIC%= * Related: [[#VarTOPIC][TOPIC]] #VarSTARTINCLUDE ---+++ STARTINCLUDE -- start position of topic text if included * 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. * Syntax: =%<nop>STARTINCLUDE%= * Related: [[#VarINCLUDE][INCLUDE]], [[#VarSTOPINCLUDE][STOPINCLUDE]] #VarSTATISTICSTOPIC ---+++ STATISTICSTOPIC -- name of statistics topic * Syntax: =%<nop>STATISTICSTOPIC%= * Expands to: =%STATISTICSTOPIC%=, renders as [[%STATISTICSTOPIC%]] * Related: [[#VarHOMETOPIC][HOMETOPIC]], [[#VarNOTIFYTOPIC][NOTIFYTOPIC]], [[#VarTOPIC][TOPIC]] #VarSTOPINCLUDE ---+++ STOPINCLUDE -- end position of topic text if included * 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. * Syntax: =%<nop>STOPINCLUDE%= * Related: [[#VarINCLUDE][INCLUDE]], [[#VarSTARTINCLUDE][STARTINCLUDE]] #VarTOC ---+++ TOC -- table of contents of current topic * Syntax: =%<nop>TOC%= * Related: [[#VarTOC2][TOC{"SomeTopic"}]] #VarTOC2 ---+++ TOC{"Topic"} -- table of contents * Syntax: =%<nop>TOC{"SomeTopic" ...}%= * 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 * Supported parameters: | *Parameter:* | *Description:* | *Default:* | | ="TopicName"= | topic name | Current topic | | =web="Name"= | Name of web | Current web | | =depth="2"= | Limit depth of headings shown in TOC | 6 | | =title="Some text"= | Title to appear at top of TOC | none | * Example: =%<nop>TOC{depth="2"}%= * Example: =%<nop>TOC{"TWikiDocumentation" web="%TWIKIWEB%" title="Contents:"}%= * Related: [[#VarTOC][TOC]] #VarTOPIC ---+++ TOPIC -- name of current topic * Syntax: =%<nop>TOPIC%= * Expands to: =%TOPIC%=, renders as [[%TOPIC%]] * Related: [[#VarBASETOPIC][BASETOPIC]], [[#VarINCLUDINGTOPIC][INCLUDINGTOPIC]], [[#VarTOPICLIST][TOPICLIST]], [[#VarWEB][WEB]] #VarTOPICLIST ---+++ TOPICLIST{"format"} -- topic index of a web * 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. * Syntax: =%<nop>TOPICLIST{"format" ...}%= * Supported parameters: | *Parameter:* | *Description:* | *Default:* | | ="format"= | Format of one line, may include =$name= and =$web= variables | ="$name"= | | =format="format"= | (Alternative to above) | ="$name"= | | =separator=", "= | line separator | ="\n"= (new line) | | =web="Name"= | Name of web | Current web | * Example: =%<nop>TOPICLIST{" * $web.$name"}%= creates a bullet list of all topics * Example: =%<nop>TOPICLIST{separator=", "}%= creates a comma separated list of all topics * Example: =%<nop>TOPICLIST{" <option>$name</option>"}%= creates an option list (for drop down menus) * Related: [[#VarSEARCH][SEARCH]], [[#VarWEBLIST][WEBLIST]] #VarTWIKIWEB ---+++ TWIKIWEB -- name of TWiki documentation web * The web containing all documentation and site-wide preference settings for %WIKITOOLNAME% * Syntax: =%<nop>TWIKIWEB%= * Expands to: =%TWIKIWEB%= * Related: [[#VarMAINWEB][MAINWEB]] #VarURLPARAM ---+++ URLPARAM{"name"} -- get value of a URL parameter * Returns the value of a URL parameter. Note that there is a risk that this variable could be misused for cross-scripting * Syntax: =%<nop>URLPARAM{"name"}%= * Supported parameters: | *Parameter:* | *Description:* | *Default:* | | ="name"= | The name of a URL parameter | required | | =default="..."= | Default value in case parameter is empty or missing | empty string | | =newline="<br />"= | Convert newlines in textarea to other delimiters | no conversion | | =encode="entity"= | Encode special characters into HTML entities, like a double quote into =&#034;=. This is needed if text is put into an HTML form field | no encoding | | =encode="url"= | Encode special characters for URL parameter use, like a double quote into =%22= | no encoding | | =multiple="on"= %BR% =multiple="[<nop>[$item]]"= | If set, gets all selected elements of a =<select multiple="multiple">= tag. A format can be specified, with =$item= indicating the element, e.g. =multiple="Option: $item"= | first element | | =separator=", "= | Separator between multiple selections. Only relevant if multiple is specified | ="\n"= (new line) | * Example: =%<nop>URLPARAM{"skin"}%= returns =print= for a =.../view/%WEB%/%TOPIC%?skin=print= URL. [[%SCRIPTURL%/viewauth%SCRIPTSUFFIX%/%WEB%/%TOPIC%?skin=print#VarURLPARAM][Test this]]: %URLPARAM{"skin"}% * Related: [[#VarSEARCH][SEARCH]], FormattedSearch #VarUSERNAME ---+++ USERNAME -- your login username * TWiki makes names available in three formats: USERNAME like =jsmith=, WIKINAME like =JohnSmith= and WIKIUSERNAME like =%MAINWEB%.JohnSmith=. A user is a %MAINWEB%.TWikiGuest in case the topic is not authenticated * Syntax: =%<nop>USERNAME%= * Expands to: =%USERNAME%= * Related: [[#VarREMOTEUSER][REMOTE_USER]], [[#VarWIKINAME][WIKINAME]], [[#VarWIKIUSERNAME][WIKIUSERNAME]], TWikiUserAuthentication #VarVAR ---+++ VAR{"NAME" web="Web"} -- get a preference value from another web * Syntax: =%<nop>VAR{"NAME" web="Web"}%= * Example: To get =%<nop>WEBBGCOLOR%= of the %MAINWEB% web write =%<nop>VAR{"WEBBGCOLOR" web="%MAINWEB%"}%=, which expands to =%VAR{"WEBBGCOLOR" web="%MAINWEB%"}%= * Related: [[#VarWEBPREFSTOPIC][WEBPREFSTOPIC]] #VarWEB ---+++ WEB -- name of current web * Syntax: =%<nop>WEB%= * Expands to: =%WEB%= * Related: [[#VarBASEWEB][BASEWEB]], [[#VarINCLUDINGWEB][INCLUDINGWEB]], [[#VarTOPIC][TOPIC]] #VarWEBLIST ---+++ WEBLIST{"format"} -- index of all webs * 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=. * Syntax: =%<nop>WEBLIST{"format" ...}%= * Supported parameters: | *Parameter:* | *Description:* | *Default:* | | ="format"= | Format of one line, may include =$name= variable | ="$name"= | | =format="format"= | (Alternative to above) | ="$name"= | | =separator=", "= | line separator | ="\n"= (new line) | | =webs="public"= | comma sep list of Web, public expands to all non-hidden | ="public"= | | =marker="selected"= | Text for =$marker= where item matches =selection=, otherwise equals =""= | ="selected"= | | =selection="%<nop>WEB%"= | Current value to be selected in list | =section="%<nop>WEB%"= | * Example: =%<nop>WEBLIST{" * [<nop>[$name.%HOMETOPIC%]]"}%= creates a bullet list of all webs. * Example: =%<nop>WEBLIST{"<option $marker value=$qname>$name</option>" webs="Trash,public" selection="%WEB%" separator=" "}%= Dropdown of all public Webs + Trash Web, current Web highlighted. * Related: [[#VarTOPICLIST][TOPICLIST]], [[#VarSEARCH][SEARCH]] #VarWEBPREFSTOPIC ---+++ WEBPREFSTOPIC -- name of web preferences topic * Syntax: =%<nop>WEBPREFSTOPIC%= * Expands to: =%WEBPREFSTOPIC%=, renders as [[%WEBPREFSTOPIC%]] * Related: [[#VarHOMETOPIC][HOMETOPIC]], [[#VarWIKIPREFSTOPIC][WIKIPREFSTOPIC]], [[#VarVAR][VAR]] #VarWIKIHOMEURL ---+++ WIKIHOMEURL -- site home URL * The base URL of %WIKITOOLNAME%, is the link of the Home icon in the upper left corner, defined in TWiki.cfg * Syntax: =%<nop>WIKIHOMEURL%= * Expands to: =%WIKIHOMEURL%= * Related: [[#VarWIKITOOLNAME][WIKITOOLNAME]] #VarWIKINAME ---+++ WIKINAME -- your Wiki username * The WikiName is the same as %<nop>USERNAME% if not defined in the %MAINWEB%.%WIKIUSERSTOPIC% topic * Syntax: =%<nop>WIKINAME%= * Expands to: =%WIKINAME%= * Related: [[#VarREMOTEUSER][REMOTE_USER]], [[#VarUSERNAME][USERNAME]], [[#VarWIKIUSERNAME][WIKIUSERNAME]], [[#VarWIKIUSERSTOPIC][WIKIUSERSTOPIC]] #VarWIKIPREFSTOPIC ---+++ WIKIPREFSTOPIC -- name of site-wide preferences topic * Syntax: =%<nop>WIKIPREFSTOPIC%= * Expands to: =%WIKIPREFSTOPIC%=, renders as [[%WIKIPREFSTOPIC%]] * Related: [[#VarHOMETOPIC][HOMETOPIC]], [[#VarWEBPREFSTOPIC][WEBPREFSTOPIC]] #VarWIKITOOLNAME ---+++ WIKITOOLNAME -- name of your TWiki site * Syntax: =%<nop>WIKITOOLNAME%= * Expands to: =%WIKITOOLNAME%= * Related: [[#VarWIKIHOMEURL][WIKIHOMEURL]], [[#VarWIKIVERSION][WIKIVERSION]] #VarWIKIUSERNAME ---+++ WIKIUSERNAME -- your Wiki username with web prefix * Your %<nop>WIKINAME% with %MAINWEB% web prefix, useful to point to your %WIKITOOLNAME% home page * Syntax: =%<nop>WIKIUSERNAME%= * Expands to: =%WIKIUSERNAME%=, renders as %WIKIUSERNAME% * Related: [[#VarREMOTEUSER][REMOTE_USER]], [[#VarUSERNAME][USERNAME]], [[#VarWIKINAME][WIKINAME]] #VarWIKIUSERSTOPIC ---+++ WIKIUSERSTOPIC -- name of topic listing all registers users * Syntax: =%<nop>WIKIUSERSTOPIC%= * Expands to: =%WIKIUSERSTOPIC%=, with %MAINWEB% prefix renders as %MAINWEB%.%WIKIUSERSTOPIC% * Related: [[#VarWIKIUSERNAME][WIKIUSERNAME]] #VarWIKIVERSION ---+++ WIKIVERSION -- the version of the installed TWiki engine * Syntax: =%<nop>WIKIVERSION%= * Expands to: =%WIKIVERSION%= * Related: [[#VarWIKITOOLNAME][WIKITOOLNAME]] #PreferencesVariables ---++ 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 cellspacing="0" cellpadding="2" border="1" align="center" style="background-color:#f5f5f5"> <tr> <th width="160"> Variable: </th><th> Level: </th><th> What: </th> </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>ALLOWTOPICRENAME%= </td> <td> __(any topic)__ </td> <td> List of users and groups who are *allowed* to rename the current topic. (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>ALLOWWEBRENAME%= </td> <td> __WL__ </td> <td> List of users and groups who are *allowed* to rename topics in the %WIKITOOLNAME% web. (More in TWikiAccessControl) </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>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>DENYTOPICRENAME%= </td> <td> __(any topic)__ </td> <td> List of users and groups who are *not allowed* to rename the current topic. (More in TWikiAccessControl) </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>DENYWEBRENAME%= </td> <td> __WL__ </td> <td> List of users and groups who are *not allowed* to rename topics in the %WIKITOOLNAME% web. (More in TWikiAccessControl) </td> </tr> <tr> <td> =%<nop>DONTNOTIFYCHECKBOX%= </td> <td> __SL__ , __UL__ </td> <td> Default state of the "Minor Changes, Don't Notify" (DontNotify) check box in preview. Check box is initially checked if =Set DONTNOTIFYCHECKBOX = checked="checked"=, or unchecked if empty. Value is: <b><code>%DONTNOTIFYCHECKBOX%</code></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>EDITBOXWIDTH%= </td> <td> __SL__ , __UL__ </td> <td> Horizontal size of edit box, is <b> =%EDITBOXWIDTH%= </b> </td> </tr> <tr> <td> =%<nop>EDITBOXSTYLE%= </td> <td> __SL__ , __UL__ </td> <td> Style of text edit box. Set to =width: 99%= for full window width (default; overwrites the EDITBOXWIDTH setting), or =width: auto= to disable. Value is: <b><code>%EDITBOXSTYLE%</code></b> </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> <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>HTTP_EQUIV_ON_VIEW%= </td> <td> __SL__ </td> <td> http-equiv meta tags for view, rdiff, attach, search* scripts. </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>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>RELEASEEDITLOCKCHECKBOX%= </td> <td> __SL__ , __UL__ </td> <td> Default state of the "Release edit lock" (UnlockTopic) check box in preview. Checkbox is initially checked if =Set RELEASEEDITLOCKCHECKBOX = checked="checked"=, or unchecked if empty. If checked, make sure to click on <u>Edit</u> to do more changes; do *not* 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> </tr> <tr> <td> =%<nop>WEBBGCOLOR%= </td> <td> __WL__ </td> <td> Background color of web </td> </tr> <tr> <td> =%<nop>WEBCOPYRIGHT%= </td> <td> __SL__ , __WL__ </td> <td> Copyright notice (bottom 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>WIKIWEBLIST%= </td> <td> __SL__ </td> <td> List of %WIKITOOLNAME% webs (in upper right corner of topics) </td> </tr> <tr> <td> =%<nop>WIKIWEBMASTER%= </td> <td> __SL__ </td> <td> Webmaster email address (sender of email notifications) , is <b>%WIKIWEBMASTER%</b> </td> </tr> </table> __Note:__ There are some more useful variables defined in the TWikiPreferences like =%<nop>BR%= for line break, colors like =%<nop>RED%= for colored text and small icons like =%<nop>H%= for a %H% Help icon. #SettingPrefs ---++ Setting Preferences * 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:__ * ==<nop>Set VARIABLENAME = value== * ==<nop>Set VARIABLENAME = value== ---++ Creating Custom Variables * You can add your own Preference Variables for us across an entire site or a single web, using the standard [[#SettingPrefs][Preferences syntax]]. 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. <blockquote style="background-color:#ffffff"> *Example: Create a custom logo variable the <nop>%WEB% web* <br /> * To place a logo anywhere in a web by typing ==%<nop>MYLOGO%==, define the Variable on the web's WebPreferences page, and upload a logo file, ex: =mylogo.gif=. You can upload by [[FileAttachment][attaching the file]] to WebPreferences, or, to avoid clutter, to any other topic in the same web, ex: =LogoTopic=: * ==<nop>Set MYLOGO = %<nop>PUBURL%/<nop>TWiki/LogoTopic/mylogo.gif== </blockquote> -- TWiki:Main.PeterThoeny - 09 May 2004 %BR% -- TWiki:Main.MikeMannix - 12 May 2002
Edit
|
Attach
|
P
rint version
|
H
istory
:
r83
|
r79
<
r78
<
r77
<
r76
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r77 - 09 May 2004 - 17:41:10 -
PeterThoeny
?
TWiki/
Log In
or
Register
TWiki/ Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
DnD
Main
Support
TWiki
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback