<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.tfcmud.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Help%3AVariable</id>
	<title>Help:Variable - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.tfcmud.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Help%3AVariable"/>
	<link rel="alternate" type="text/html" href="https://www.tfcmud.com/wiki/index.php?title=Help:Variable&amp;action=history"/>
	<updated>2026-04-30T13:59:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://www.tfcmud.com/wiki/index.php?title=Help:Variable&amp;diff=312&amp;oldid=prev</id>
		<title>Tynian: 1 revision: Import helps</title>
		<link rel="alternate" type="text/html" href="https://www.tfcmud.com/wiki/index.php?title=Help:Variable&amp;diff=312&amp;oldid=prev"/>
		<updated>2011-01-10T23:24:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision: Import helps&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''This page shows the values of the site-dependent variables on this wiki. The rest of the page has been deprecated by &amp;quot;[[mw:Help:Magic words|Help:Magic words]]&amp;quot; on MediaWiki.org, and is kept here for the convenience of users following links from other wikis. Any modifications, if still appropriate, should be made on that page.'''&lt;br /&gt;
[[Category:Moved to MediaWiki]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{{H:h|editor toc}}&lt;br /&gt;
A '''variable''' can be considered a [[Help:Template#Predefined_templates|predefined template]] without parameters. See also [[Help:Parser function]].&lt;br /&gt;
&lt;br /&gt;
This is a list of variables that can be used in the wikitext. The way they are rendered vary with time (directly depending on time, or  e.g. for number of articles, depending on the creation of other articles), on the project (it changes when the wikitext is copied), or on the page in which it occurs (it changes when the wikitext is copied, when the page is renamed, and when the page is included in another page).&lt;br /&gt;
&lt;br /&gt;
On the left is the variable, on the right how it is rendered at this time, in this project, on this page.&lt;br /&gt;
&lt;br /&gt;
The names of the variables form part of the set of so-called &amp;quot;[[Help:Magic words|magic words]]&amp;quot; the system uses.&lt;br /&gt;
&lt;br /&gt;
With [[Special:ExpandTemplates]] one can view the value of a variable, or more generally, the expanded wikitext a variable or a wikitext with variables and/or template calls produces, as intermediate step toward rendering.&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
&lt;br /&gt;
{| &lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{SITENAME}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| {{SITENAME}} &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{SERVER}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| {{SERVER}} &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{SERVERNAME}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| {{SERVERNAME}} &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{CONTENTLANGUAGE}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| {{CONTENTLANGUAGE}}&lt;br /&gt;
| code of the site's default interface language ({{h:mwg|LanguageCode}})&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Depending on page==&lt;br /&gt;
&lt;br /&gt;
{{H:Page name variables}}&lt;br /&gt;
&lt;br /&gt;
For the rendering on page A, these variables depend on page A, even if  page A contains the variable due to [[help:template|inclusion]] of page B. Variables in the [[Help:Category#Sort_key|sort key]] of a category tag refer to the page with the tag, not the category page where it takes effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;{{NAMESPACE}}&amp;lt;/nowiki&amp;gt; and &amp;lt;nowiki&amp;gt;{{NAMESPACEE}}&amp;lt;/nowiki&amp;gt; return an empty string in the article namespace &amp;lt;nowiki&amp;gt;{{ns:0}}&amp;lt;/nowiki&amp;gt;,&lt;br /&gt;
see above and [[Help:Parser function#NS:0|NS:0]]. &lt;br /&gt;
  &lt;br /&gt;
PAGENAMEE displays the page title in the form that is used in URLs, i.e. with underscores for spaces, and percent-encoding for special characters, and is therefore used for constructing URLs incl. ''query strings''.&lt;br /&gt;
&lt;br /&gt;
For example, on [[m:Template talk:!|Template talk:!]], SUBJECTPAGENAMEE would produce &amp;lt;tt&amp;gt;Template:%21&amp;lt;/tt&amp;gt;. &lt;br /&gt;
Don't encode PAGENAMEE etc. again, i.e. don't use it in the first parameter of '''fullurl:''' and similar parser functions,&lt;br /&gt;
&amp;lt;nowiki&amp;gt;{{urlencode:%21}}&amp;lt;/nowiki&amp;gt; = {{urlencode:%21}} probably won't work as expected. &amp;lt;small&amp;gt;''Query strings''&amp;amp;#160; in [[purlnet:|PURL]] redirections are an exception.&amp;lt;/small&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;EE&amp;quot; encoding examples shown above for this page are not very interesting, only TALKPAGENAMEE and TALKSPACEE differ from TALKPAGENAME and TALKSPACE.&lt;br /&gt;
See [[Help:Link]] and [[Help:Magic words]] for other examples.&lt;br /&gt;
&lt;br /&gt;
In a subpage, &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;[[../]]&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; renders as a link to the parent page. For example, on [[m:Link/a/b]] it gives an internal link to [[m:Link/a]], see [[Help:Link#Subpage feature]].&lt;br /&gt;
&lt;br /&gt;
{{xpdoc|REVISIONID}} showing the '''current''' unique revision number of a saved page as used for [[Help:diff|diff]]s in the [[Help:page history|page history]] is in essence [[mediazilla:6181|useless]], it can't be substituted and also doesn't work in preview.&lt;br /&gt;
&lt;br /&gt;
==Varying with time==&lt;br /&gt;
{{seealso|:en:Category:Date-computing templates}}&lt;br /&gt;
===Time=== &lt;br /&gt;
The time in [[w:UTC|UTC]].  Note that if the page was displayed by the same user and has not changed (page has not been edited) since the last time it was displayed, it is possible that the page may be cached (by the user's browser) and the displayed time or date may not change.  Also, if a heavily used page, rather than freshly rendered by the software each time it is generated, is instead being retrieved from a caching system (such as the main page on Wikipedia) the date or time may not change from the last time the page was originally retrieved by the caching hardware or software.&lt;br /&gt;
{{H:Current time variables}}&lt;br /&gt;
&lt;br /&gt;
===Local time===&lt;br /&gt;
Local time depends on the local timezone of the wiki, not the time zone in the user preferences. These should generally use {{[[Help:ParserFunctions#.23time:|#time:]]}} if [[ParserFunctions]] are installed, but the following legacy variables are also available from MediaWiki 1.8+.&lt;br /&gt;
&lt;br /&gt;
{{H:Local time variables}}&lt;br /&gt;
&lt;br /&gt;
Because of the way MediaWiki and most browsers cache HTML pages, time variables which change more often than once a day will typically show the time the page was last cached, rather than the current time.&lt;br /&gt;
&lt;br /&gt;
=== Statistics ===&lt;br /&gt;
&lt;br /&gt;
See '''[[Help:Magic_words#Statistics|Statistics]]'''.&lt;br /&gt;
&lt;br /&gt;
===Substitution===&lt;br /&gt;
&lt;br /&gt;
:''Main article: '''[[Help:Substitution]]'''''&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;includeonly&amp;gt;subst:&amp;lt;/includeonly&amp;gt;CURRENTTIMESTAMP}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is included and thereby substituted, the timestamp of doing that is put in the wikitext, and similarly for other variables. Examples:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{CURRENTTIMESTAMP}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{CURRENTTIMESTAMP}} - stays a variable on pages including the template&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{subst:CURRENTTIMESTAMP}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:20060526024210 - became a substituted constant in the template&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;includeonly&amp;gt;subst:&amp;lt;/includeonly&amp;gt;CURRENTTIMESTAMP}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{&amp;lt;includeonly&amp;gt;subst:&amp;lt;/includeonly&amp;gt;CURRENTTIMESTAMP}} - becomes a constant at the time of its inclusion&lt;br /&gt;
&lt;br /&gt;
Templates with the &amp;quot;''includeonly subst magic''&amp;quot; must also be subst-ed.&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; &lt;br /&gt;
! Word &lt;br /&gt;
! Example &lt;br /&gt;
! Example results&lt;br /&gt;
! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{PAGESINCATEGORY:category}}&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;nowiki&amp;gt;{{PAGESINCATEGORY:category|R}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PAGESINCATEGORY:User en}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PAGESINCATEGORY:User en|R}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;{{PAGESINCATEGORY:User en}}&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;{{PAGESINCATEGORY:User en|R}}&amp;lt;/code&amp;gt;&lt;br /&gt;
| '''[MW1.13+]''' Returns the number of pages in a given category.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;{{PAGESINCAT:category}}&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;nowiki&amp;gt;{{PAGESINCAT:category|R}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PAGESINCAT:User en}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PAGESINCAT:User en|R}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;{{PAGESINCAT:User en}}&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;code&amp;gt;{{PAGESINCAT:User en|R}}&amp;lt;/code&amp;gt;&lt;br /&gt;
| '''[MW1.13+]''' Alias of PAGESINCATEGORY.&lt;br /&gt;
|}{{-}}&lt;br /&gt;
&lt;br /&gt;
==Examples of combinations with parser functions==&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{fullurl:{{FULLPAGENAME}}|&amp;lt;/nowiki&amp;gt;action=edit&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{fullurl:{{FULLPAGENAME}}|action=edit}}&lt;br /&gt;
: &amp;amp;#160;&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{fullurl:w:en:Special:Whatlinkshere|target={{NAMESPACE}}:Contents}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{fullurl:w:en:Special:Whatlinkshere|target={{NAMESPACE}}:Contents}}&lt;br /&gt;
: &amp;amp;#160;&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{fullurl:m:Special:Whatlinkshere|target={{FULLPAGENAME}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{fullurl:m:Special:Whatlinkshere|target={{FULLPAGENAME}}}}&lt;br /&gt;
: &amp;amp;#160;&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[{{NAMESPACE}} talk:{{PAGENAME}}]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:[[{{NAMESPACE}} talk:{{PAGENAME}}]]&lt;br /&gt;
: &amp;amp;#160;&lt;br /&gt;
;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{fullurl:{{NAMESPACE}} talk:{{PAGENAME}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:{{fullurl:{{NAMESPACE}} talk:{{PAGENAME}}}}&lt;br /&gt;
: &amp;amp;#160;&lt;br /&gt;
&lt;br /&gt;
The old form &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{SERVER}}{{localurl:&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;''page''&amp;lt;small&amp;gt;&amp;amp;#160;&amp;lt;/small&amp;gt;&amp;lt;code&amp;gt;&amp;amp;#125;}&amp;lt;/code&amp;gt; does not always work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{SERVER}}{{localurl:Wikipedia:Category&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;small&amp;gt;&amp;amp;#160;&amp;lt;/small&amp;gt;&amp;lt;code&amp;gt;&amp;amp;#125;}&amp;lt;/code&amp;gt;&lt;br /&gt;
gives {{SERVER}}{{localurl:Wikipedia:Category}}&lt;br /&gt;
&lt;br /&gt;
Apart from those problems it is in essence the same as&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{fullurl:&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;''page''&amp;lt;small&amp;gt;&amp;amp;#160;&amp;lt;/small&amp;gt;&amp;lt;code&amp;gt;&amp;amp;#125;}&amp;lt;/code&amp;gt; in recent ('''1.5+''') versions of the software.&lt;br /&gt;
&lt;br /&gt;
In a template, for a link to a page which depends on a template parameter, the external link style is used even for internal links, to avoid that the system links to the edit page even if the page exists. To construct the external link, variables can also be useful.&lt;br /&gt;
&lt;br /&gt;
==Variable in the form of a template call==&lt;br /&gt;
If the syntax of a template call with parameters is applied with the name of a variable, depending on the variable the parameters are either ignored or cause the variable to be interpreted as a (non-existing) template:&lt;br /&gt;
&lt;br /&gt;
#Variables like {&amp;amp;#123;NUMBEROFPAGES:R&amp;amp;#125;} = {{NUMBEROFPAGES:R}} with a &amp;quot;raw&amp;quot; format are always handled as variable, {&amp;amp;#123;NUMBEROFPAGES:R|Para|meter&amp;amp;#125;}&amp;amp;#160;= {{NUMBEROFPAGES:R|Para|meter}}.&lt;br /&gt;
#Other variables like {&amp;amp;#123;CURRENTDAYNAME&amp;amp;#125;} = {{CURRENTDAYNAME}} are handled as template for given parameter(s), {&amp;amp;#123;CURRENTDAYNAME|x&amp;amp;#125;}&amp;amp;#160;= {{CURRENTDAYNAME|x}}.&lt;br /&gt;
#Parser functions like {&amp;amp;#123;lc: Lower Case&amp;amp;#125;} = {{lc: Lower Case}} ignore extraneous parameters, {&amp;amp;#123;lc:&amp;amp;#160;Lower|Case&amp;amp;#125;}&amp;amp;#160;= {{lc: Lower|Case}}.&lt;br /&gt;
#Parser function ns (e.g. {&amp;amp;#123;ns: 1&amp;amp;#125;} = {{ns: 1}}) gives an empty string for a non-applicable numerical parameter value, and evaluates in the case of a non-numerical parameter value as template (the template name being the whole text until &amp;quot;|&amp;quot; or &amp;quot;}}&amp;quot;):&lt;br /&gt;
#:{&amp;amp;#123;ns: 1234&amp;amp;#125;}&amp;amp;#160;= {{ns: 1234}}&lt;br /&gt;
#:{&amp;amp;#123;ns: t|abc&amp;amp;#125;}&amp;amp;#160;= {{ns: t|abc}}&lt;br /&gt;
#Parser functions like fullurl don't support the &amp;lt;tt&amp;gt;../&amp;lt;/tt&amp;gt; notation, and in namespaces supporting subpages this has odd effects: like above, they evaluate such an invalid parameter value as template, see [[Link/a]] and [[Link/a/b]]. Here it just renders the wikitext:&lt;br /&gt;
#:{&amp;amp;#123;fullurl:../a&amp;amp;#125;}&amp;amp;#160;= {{fullurl:../a}}.&lt;br /&gt;
#: The cases #2, #4, and #5 resulting in template calls are probably related.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Help:Parser function]]: a way of integrating with the parser more tightly since version 1.7.0&lt;br /&gt;
*[[Extending wiki markup#Parser functions|Adding parser functions]]&lt;br /&gt;
*The [[Help:ParserFunctions|ParserFunctions]] extension ('''#expr:''', '''#if:''', '''#ifeq:''', etc.; '''#titleparts:''')&lt;br /&gt;
*[[Help:Substitution]]: on applying &amp;quot;subst&amp;quot; to a variable or to a template using a variable&lt;br /&gt;
*[[mw:Manual:Magic words]]&lt;br /&gt;
*[[mw:Extension:Variables]]: ''adding new magic words like &amp;lt;nowiki&amp;gt;{{CURRENTUSER}}&amp;lt;/nowiki&amp;gt;''&lt;br /&gt;
*[http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/includes/MagicWord.php MagicWord.php]&lt;br /&gt;
*{{ml|Help:User style|Variables|JavaScript variables supplied by the server}}&lt;br /&gt;
&lt;br /&gt;
{{h:f|enname=Variable}}&lt;/div&gt;</summary>
		<author><name>Tynian</name></author>
	</entry>
</feed>