This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.

Difference between revisions of "Help:Variables"

From SuperTux
Jump to: navigation, search
m (Mirror from http://www.mediawiki.org/wiki/Help:Variables)
 
m (Mirror from http://www.mediawiki.org/wiki/Help:Variables)
 
Line 1: Line 1:
 
{{PD Help Page}}
 
{{PD Help Page}}
MediaWiki knows some defined variables which can be used in texts. They are rendered differently depending on the time, the site and the page. Their syntax is similar to templates. If you want a page to show always the current time, you use <code><nowiki>{{CURRENTTIME}}</nowiki></code>. To distinguish variables from templates, most variables are capitalized.
 
  
<center>
+
MediaWiki '''variables''' are strings of text that output as information such as time, site details, or page names.
{| {{Prettytable}}
+
 
 +
==Parsing==
 +
The syntax of most variables is similar to [[Help:Templates|templates]], but capitalized to help avoid conflicts. If a template has the same name and case as a variable, the variable will be used. Usage of the template can be forced by adding the "msg:" modifier (for example, "<code><nowiki>{{msg:CURRENTYEAR}}</nowiki></code>").
 +
 
 +
Page-dependent variables will return data about the currently-viewed page, regardless of whether the variable is in the page code or a transcluded template.
 +
 
 +
==Variables==
 +
===Date & time===
 +
The following variables return the current date and time according to the user's timezone [[Special:Preferences|preferences]], defaulting to the UTC timezone.
 +
 
 +
Due to MediaWiki and browser caching, these variables frequently show when the page was ''cached'' rather than the current time.
 +
 
 +
{| {{prettytable}}
 
|-
 
|-
!{{Hl3}}|'''Description'''
+
!{{Hl2}}| Variable
!{{Hl3}}|'''You type'''
+
!{{Hl2}}| Output
!{{Hl3}}|'''You get'''
+
!{{Hl2}}| Description
 
|-
 
|-
! {{Hl2}} colspan="3" | '''Date & Wiki variables'''
+
|colspan="3"| '''Year'''
 
|-
 
|-
| Current month
+
| <nowiki>{{CURRENTYEAR}}</nowiki>
|<nowiki>{{CURRENTMONTH}}</nowiki>  
+
| {{CURRENTYEAR}}
|{{CURRENTMONTH}}
+
| Year
 
|-
 
|-
| Current month
+
|colspan="3"| '''Month'''
|<nowiki>{{CURRENTMONTHNAME}}</nowiki>
+
|{{CURRENTMONTHNAME}}
+
 
|-
 
|-
| Genitive form<br>of current month name
+
 
|<nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki>
+
| <nowiki>{{CURRENTMONTH}}</nowiki>  
|{{CURRENTMONTHNAMEGEN}}
+
| {{CURRENTMONTH}}
 +
| Month (zero-padded number)
 
|-
 
|-
| Abbreviated month name
+
| <nowiki>{{CURRENTMONTHNAME}}</nowiki>
|<nowiki>{{CURRENTMONTHABBREV}}</nowiki>
+
| {{CURRENTMONTHNAME}}
|{{CURRENTMONTHABBREV}}
+
| Month (name)
 
|-
 
|-
|Day of the month
+
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki>
|<nowiki>{{CURRENTDAY}}</nowiki>
+
| {{CURRENTMONTHNAMEGEN}}
|{{CURRENTDAY}}
+
| Month ([http://en.wikipedia.org/wiki/genitive genitive form])
 
|-
 
|-
|Day of the week
+
| <nowiki>{{CURRENTMONTHABBREV}}</nowiki>
|<nowiki>{{CURRENTDOW}}</nowiki>
+
| {{CURRENTMONTHABBREV}}
|{{CURRENTDOW}}
+
| Month (abbreviation)
 
|-
 
|-
|Day of the week
+
|colspan="3"| '''Day'''
|<nowiki>{{CURRENTDAYNAME}}</nowiki>
+
|{{CURRENTDAYNAME}}
+
 
|-
 
|-
| Week
+
| <nowiki>{{CURRENTDAY}}</nowiki>
|<nowiki>{{CURRENTWEEK}}</nowiki>
+
| {{CURRENTDAY}}
|{{CURRENTWEEK}}
+
| Day of the month (unpadded number)
 
|-
 
|-
| Year
+
| <nowiki>{{CURRENTDAY2}}</nowiki>
|<nowiki>{{CURRENTYEAR}}</nowiki>
+
| {{CURRENTDAY2}}
|{{CURRENTYEAR}}
+
| Day of the month (zero-padded number)
 
|-
 
|-
| current time
+
| <nowiki>{{CURRENTDOW}}</nowiki>
|<nowiki>{{CURRENTTIME}}</nowiki>
+
| {{CURRENTDOW}}
|{{CURRENTTIME}}
+
| Day of the week (unpadded number)
 
|-
 
|-
| numbers of articles in this Wiki
+
| <nowiki>{{CURRENTDAYNAME}}</nowiki>
|<nowiki>{{NUMBEROFARTICLES}}</nowiki>
+
| {{CURRENTDAYNAME}}
|{{NUMBEROFARTICLES}}
+
| Day of the week (name)
 
|-
 
|-
| numbers of uploaded files
+
|colspan="3"| '''Time'''
|<nowiki>{{NUMBEROFFILES}}</nowiki>
+
|{{NUMBEROFFILES}}
+
 
|-
 
|-
! {{Hl2}} colspan="3" | '''Namespaces'''
+
| <nowiki>{{CURRENTTIME}}</nowiki>
 +
| {{CURRENTTIME}}
 +
| Time (24-hour HH:mm format)
 
|-
 
|-
|
+
| <nowiki>{{CURRENTHOUR}}</nowiki>
|<nowiki>{{ns:-2}} or {{ns:Media}}</nowiki>
+
| {{CURRENTHOUR}}
|{{ns:-2}}
+
| Hour (24-hour zero-padded number)
 
|-
 
|-
|
+
|colspan="3"| '''Other'''
|<nowiki>{{ns:-1}} or {{ns:Special}}</nowiki>
+
|{{ns:-1}}
+
 
|-
 
|-
|
+
| <nowiki>{{CURRENTWEEK}}</nowiki>
|<nowiki>{{ns:1}} or {{ns:Talk}}</nowiki>
+
| {{CURRENTWEEK}}
 +
| Week (number)
 +
|-
 +
| <nowiki>{{CURRENTTIMESTAMP}}</nowiki>
 +
| {{CURRENTTIMESTAMP}}
 +
| ISO 8601 time stamp
 +
|}
 +
 
 +
The following variables do the same as the above, but using the site's local timezone instead of user preferences and UTC:
 +
* <nowiki>{{LOCALYEAR}}</nowiki>
 +
* <nowiki>{{LOCALMONTH}}</nowiki>
 +
* <nowiki>{{LOCALMONTHNAME}}</nowiki>
 +
* <nowiki>{{LOCALMONTHABBREV}}</nowiki>
 +
* <nowiki>{{LOCALDAY}}</nowiki>
 +
* <nowiki>{{LOCALDAY2}}</nowiki>
 +
* <nowiki>{{LOCALDOW}}</nowiki>
 +
* <nowiki>{{LOCALDAYNAME}}</nowiki>
 +
* <nowiki>{{LOCALTIME}}</nowiki>
 +
* <nowiki>{{LOCALHOUR}}</nowiki>
 +
* <nowiki>{{LOCALWEEK}}</nowiki>
 +
* <nowiki>{{LOCALTIMESTAMP}}</nowiki>
 +
 
 +
===Statistics and technical details===
 +
====Site====
 +
{| {{prettytable}}
 +
|-
 +
!{{Hl2}}| Variable
 +
!{{Hl2}}| Output
 +
!{{Hl2}}| Description
 +
|-
 +
| <nowiki>{{SITENAME}}</nowiki>
 +
| {{SITENAME}}
 +
| Name of the wiki ({{mediawiki|Manual:$wgSitename|$wgSitename}})
 +
|-
 +
| <nowiki>{{CONTENTLANGUAGE}}</nowiki>
 +
| {{CONTENTLANGUAGE}}
 +
| Default interface language ({{mediawiki|Manual:$wgLanguageCode|$wgLanguageCode}})
 +
|-
 +
| <nowiki>{{NUMBEROFPAGES}}</nowiki>
 +
| {{NUMBEROFPAGES}}
 +
| Number of wiki pages
 +
|-
 +
| <nowiki>{{NUMBEROFARTICLES}}</nowiki>
 +
| {{NUMBEROFARTICLES}}
 +
| Number of pages in main namespace
 +
|-
 +
| <nowiki>{{NUMBEROFFILES}}</nowiki>
 +
| {{NUMBEROFFILES}}
 +
| Number of uploaded files
 +
|}
 +
 
 +
====Latest revision to a page====
 +
The following variables return data about the '''latest edit to the current page''', even if viewing an older version of the page.
 +
 
 +
{| {{prettytable}}
 +
|-
 +
!{{Hl2}}| Variable
 +
!{{Hl2}}| Output
 +
!{{Hl2}}| Description
 +
|-
 +
| <nowiki>{{REVISIONID}}</nowiki>
 +
| {{REVISIONID}}
 +
| Unique ID
 +
|-
 +
| <nowiki>{{REVISIONDAY}}</nowiki>
 +
| {{REVISIONDAY}}
 +
| Day edit was made (unpadded number)
 +
|-
 +
| <nowiki>{{REVISIONDAY2}}</nowiki>
 +
| {{REVISIONDAY2}}
 +
| Day edit was made (zero-padded number)
 +
|-
 +
| <nowiki>{{REVISIONMONTH}}</nowiki>
 +
| {{REVISIONMONTH}}
 +
| Month edit was made (unpadded number)
 +
|-
 +
| <nowiki>{{REVISIONYEAR}}</nowiki>
 +
| {{REVISIONYEAR}}
 +
| Year edit was made
 +
|-
 +
| <nowiki>{{REVISIONTIMESTAMP}}</nowiki>
 +
| {{REVISIONTIMESTAMP}}
 +
| Timestamp as of time of edit
 +
|}
 +
 
 +
===URL data===
 +
====URLs====
 +
{| {{prettytable}}
 +
|-
 +
!{{Hl2}}| Variable
 +
!{{Hl2}}| Output
 +
!{{Hl2}}| Description
 +
|-
 +
| <nowiki>{{SERVER}}</nowiki>
 +
| {{SERVER}}
 +
| domain URL ({{mediawiki|Manual:$wgServer|$wgServer}})
 +
|-
 +
| <nowiki>{{SERVERNAME}}</nowiki>
 +
| {{SERVERNAME}}
 +
| domain name ({{mediawiki|Manual:$wgServerName|$wgServerName}})
 +
|-
 +
| <nowiki>{{SCRIPTPATH}}</nowiki>
 +
| {{SCRIPTPATH}}
 +
| relative script path ({{mediawiki|Manual:$wgScriptPath|$wgScriptPath}})
 +
|-
 +
| <nowiki>{{localurl:</nowiki>''pagename''<nowiki>}}</nowiki><br /><nowiki>{{localurl:pagename|</nowiki>''query string''<nowiki>}}</nowiki>
 +
| {{localurl:pagename}}<br />{{localurl:pagename|query string}}
 +
| relative path to title
 +
|}
 +
 
 +
====Page names====
 +
{| {{prettytable}}
 +
|-
 +
!{{Hl2}}| Variable
 +
!{{Hl2}}| Output
 +
!{{Hl2}}| Description
 +
|-
 +
| <nowiki>{{FULLPAGENAME}}</nowiki>
 +
| {{FULLPAGENAME}}
 +
| Namespace and page title
 +
|-
 +
| <nowiki>{{BASEPAGENAME}}</nowiki>
 +
| {{BASEPAGENAME}}
 +
| The namespace and page title excluding the current [[Help:subpage|subpage]] ("Title" on "Title/foo")
 +
|-
 +
| <nowiki>{{PAGENAME}}</nowiki>
 +
| {{PAGENAME}}
 +
| Page title
 +
|-
 +
| <nowiki>{{SUBPAGENAME}}</nowiki>
 +
| {{SUBPAGENAME}}
 +
| The [[Help:subpage|subpage]] title ("foo" on "Title/foo")
 +
|-
 +
| <nowiki>{{SUBJECTPAGENAME}}</nowiki>
 +
| {{SUBJECTPAGENAME}}
 +
| The title of the associated content page.
 +
|-
 +
| <nowiki>{{TALKPAGENAME}}</nowiki>
 +
| {{TALKPAGENAME}}
 +
| The title of the associated talk page.
 +
|}
 +
 
 +
The following are URL-encoded equivalents:
 +
* <nowiki>{{FULLPAGENAMEE}}</nowiki>
 +
* <nowiki>{{PAGENAMEE}}</nowiki>
 +
* <nowiki>{{BASEPAGENAMEE}}</nowiki>
 +
* <nowiki>{{SUBPAGENAMEE}}</nowiki>
 +
* <nowiki>{{SUBJECTPAGENAMEE}}</nowiki>
 +
* <nowiki>{{TALKPAGENAMEE}}</nowiki>
 +
 
 +
====Namespaces====
 +
{| {{prettytable}}
 +
|-
 +
!{{Hl2}}| Variable
 +
!{{Hl2}}| Output
 +
!{{Hl2}}| Description
 +
|-
 +
| <nowiki>{{NAMESPACE}}</nowiki>
 +
| {{NAMESPACE}}
 +
| Namespace (name)
 +
|-
 +
| <nowiki>{{SUBJECTSPACE}}</nowiki>
 +
| {{SUBJECTSPACE}}
 +
| Name of the associated content namespace
 +
|-
 +
| <nowiki>{{TALKSPACE}}</nowiki>
 +
| {{TALKSPACE}}
 +
| Name of the associated talk namespace
 +
|}
 +
 
 +
The following are URL-encoded equivalents:
 +
* <nowiki>{{NAMESPACEE}}</nowiki>
 +
* <nowiki>{{SUBJECTSPACEE}}</nowiki>
 +
* <nowiki>{{TALKSPACEE}}</nowiki>
 +
 
 +
<code><nowiki>{{ns:}}</nowiki></code> returns the localized namespace name for that number of constant. The default values are:
 +
 
 +
{| {{prettytable}}
 +
|-
 +
!{{Hl2}}| Usage
 +
!{{Hl2}}| Output
 +
|-
 +
| <nowiki>{{ns:-2}} or {{ns:Media}}</nowiki>
 +
| {{ns:-2}}
 +
|-
 +
| <nowiki>{{ns:-1}} or {{ns:Special}}</nowiki>
 +
| {{ns:-1}}
 +
|-
 +
| <nowiki>{{ns:0}} or {{ns:Main}}</nowiki>
 +
| {{ns:0}}
 +
|-
 +
| <nowiki>{{ns:1}} or {{ns:Talk}}</nowiki>
 
| {{ns:1}}
 
| {{ns:1}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:2}} or {{ns:User}}</nowiki>
 
| <nowiki>{{ns:2}} or {{ns:User}}</nowiki>
 
| {{ns:2}}
 
| {{ns:2}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:3}} or {{ns:User_talk}}</nowiki>
 
| <nowiki>{{ns:3}} or {{ns:User_talk}}</nowiki>
 
| {{ns:3}}
 
| {{ns:3}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:4}} or {{ns:Project}}</nowiki>
 
| <nowiki>{{ns:4}} or {{ns:Project}}</nowiki>
 
| {{ns:4}}
 
| {{ns:4}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:5}} or {{ns:Project_talk}}</nowiki>
 
| <nowiki>{{ns:5}} or {{ns:Project_talk}}</nowiki>
 
| {{ns:5}}
 
| {{ns:5}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:6}} or {{ns:Image}}</nowiki>
 
| <nowiki>{{ns:6}} or {{ns:Image}}</nowiki>
 
| {{ns:6}}
 
| {{ns:6}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:7}} or {{ns:Image_talk}}</nowiki>
 
| <nowiki>{{ns:7}} or {{ns:Image_talk}}</nowiki>
 
| {{ns:7}}
 
| {{ns:7}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:8}} or {{ns:MediaWiki}}</nowiki>
 
| <nowiki>{{ns:8}} or {{ns:MediaWiki}}</nowiki>
 
| {{ns:8}}
 
| {{ns:8}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:9}} or {{ns:MediaWiki_talk}}</nowiki>
 
| <nowiki>{{ns:9}} or {{ns:MediaWiki_talk}}</nowiki>
 
| {{ns:9}}
 
| {{ns:9}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:10}} or {{ns:Template}}</nowiki>
 
| <nowiki>{{ns:10}} or {{ns:Template}}</nowiki>
 
| {{ns:10}}
 
| {{ns:10}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:11}} or {{ns:Template_talk}}</nowiki>
 
| <nowiki>{{ns:11}} or {{ns:Template_talk}}</nowiki>
 
| {{ns:11}}
 
| {{ns:11}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:12}} or {{ns:Help}}</nowiki>
 
| <nowiki>{{ns:12}} or {{ns:Help}}</nowiki>
 
| {{ns:12}}
 
| {{ns:12}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:13}} or {{ns:Help_talk}}</nowiki>
 
| <nowiki>{{ns:13}} or {{ns:Help_talk}}</nowiki>
 
| {{ns:13}}
 
| {{ns:13}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:14}} or {{ns:Category}}</nowiki>
 
| <nowiki>{{ns:14}} or {{ns:Category}}</nowiki>
 
| {{ns:14}}
 
| {{ns:14}}
 
|-
 
|-
|
 
 
| <nowiki>{{ns:15}} or {{ns:Category_talk}}</nowiki>
 
| <nowiki>{{ns:15}} or {{ns:Category_talk}}</nowiki>
 
| {{ns:15}}
 
| {{ns:15}}
|-
 
! {{Hl2}} colspan="3" | '''Server specific'''
 
|-
 
| Sitename
 
| <nowiki>{{SITENAME}}</nowiki>
 
| {{SITENAME}}
 
|-
 
| Servername
 
| <nowiki>{{SERVERNAME}}</nowiki>
 
| {{SERVERNAME}}
 
|-
 
| Server
 
| <nowiki>{{SERVER}}</nowiki>
 
| {{SERVER}}
 
|-
 
|-
 
| Script path
 
| <nowiki>{{SCRIPTPATH}}</nowiki>
 
| {{SCRIPTPATH}}
 
|-
 
| Local part of the URL<br>
 
| <nowiki>{{localurl:pagename}}</nowiki>
 
| {{localurl:pagename}}
 
|-
 
|
 
| <nowiki>{{localurl:pagename|</nowiki>''query string''<nowiki>}}</nowiki>
 
| {{localurl:pagename|''query string''}}
 
|-
 
! {{Hl2}} colspan="3" | '''Page related'''
 
|-
 
| Pagename
 
| <nowiki>{{PAGENAME}}</nowiki>
 
| {{PAGENAME}}
 
|-
 
| Pagename<br>(URL encoded)
 
| <nowiki>{{PAGENAMEE}}</nowiki>
 
| {{PAGENAMEE}}
 
|-
 
| Namespace
 
| <nowiki>{{NAMESPACE}}</nowiki>
 
| {{NAMESPACE}}
 
|-
 
| Revision ID
 
| <nowiki>{{REVISIONID}}</nowiki>
 
| {{REVISIONID}}
 
 
|}
 
|}
</center>
+
 
 +
== Custom variables ==
 +
MediaWiki also supports custom variables defined as part of extensions or specific to a particular installation.  For example, some installations  might find it helpful to have a variable that identifies the name of the sponsoring organization or the portion of the wiki URL that precedes the title if it is liable to change or more complex than <code><nowiki>http://{{SERVERNAME}}</nowiki></code>.
 +
 
 +
 
 +
For more information, please see [[Manual:Variables]].
  
 
==External links==
 
==External links==

Latest revision as of 12:42, 11 October 2007

This page was automatically mirrored from http://www.mediawiki.org/wiki/Help:Variables


MediaWiki variables are strings of text that output as information such as time, site details, or page names.

Parsing

The syntax of most variables is similar to templates, but capitalized to help avoid conflicts. If a template has the same name and case as a variable, the variable will be used. Usage of the template can be forced by adding the "msg:" modifier (for example, "{{msg:CURRENTYEAR}}").

Page-dependent variables will return data about the currently-viewed page, regardless of whether the variable is in the page code or a transcluded template.

Variables

Date & time

The following variables return the current date and time according to the user's timezone preferences, defaulting to the UTC timezone.

Due to MediaWiki and browser caching, these variables frequently show when the page was cached rather than the current time.

Variable Output Description
Year
{{CURRENTYEAR}} 2021 Year
Month
{{CURRENTMONTH}} 10 Month (zero-padded number)
{{CURRENTMONTHNAME}} October Month (name)
{{CURRENTMONTHNAMEGEN}} October Month (genitive form)
{{CURRENTMONTHABBREV}} Oct Month (abbreviation)
Day
{{CURRENTDAY}} 20 Day of the month (unpadded number)
{{CURRENTDAY2}} 20 Day of the month (zero-padded number)
{{CURRENTDOW}} 3 Day of the week (unpadded number)
{{CURRENTDAYNAME}} Wednesday Day of the week (name)
Time
{{CURRENTTIME}} 09:50 Time (24-hour HH:mm format)
{{CURRENTHOUR}} 09 Hour (24-hour zero-padded number)
Other
{{CURRENTWEEK}} 42 Week (number)
{{CURRENTTIMESTAMP}} 20211020095033 ISO 8601 time stamp

The following variables do the same as the above, but using the site's local timezone instead of user preferences and UTC:

  • {{LOCALYEAR}}
  • {{LOCALMONTH}}
  • {{LOCALMONTHNAME}}
  • {{LOCALMONTHABBREV}}
  • {{LOCALDAY}}
  • {{LOCALDAY2}}
  • {{LOCALDOW}}
  • {{LOCALDAYNAME}}
  • {{LOCALTIME}}
  • {{LOCALHOUR}}
  • {{LOCALWEEK}}
  • {{LOCALTIMESTAMP}}

Statistics and technical details

Site

Variable Output Description
{{SITENAME}} SuperTux Name of the wiki ($wgSitename)
{{CONTENTLANGUAGE}} en Default interface language ($wgLanguageCode)
{{NUMBEROFPAGES}} 1,694 Number of wiki pages
{{NUMBEROFARTICLES}} 287 Number of pages in main namespace
{{NUMBEROFFILES}} 734 Number of uploaded files

Latest revision to a page

The following variables return data about the latest edit to the current page, even if viewing an older version of the page.

Variable Output Description
{{REVISIONID}} 8856 Unique ID
{{REVISIONDAY}} 11 Day edit was made (unpadded number)
{{REVISIONDAY2}} 11 Day edit was made (zero-padded number)
{{REVISIONMONTH}} 10 Month edit was made (unpadded number)
{{REVISIONYEAR}} 2007 Year edit was made
{{REVISIONTIMESTAMP}} 20071011124215 Timestamp as of time of edit

URL data

URLs

Variable Output Description
{{SERVER}} https://supertux.lethargik.org domain URL ($wgServer)
{{SERVERNAME}} supertux.lethargik.org domain name ($wgServerName)
{{SCRIPTPATH}} /wiki relative script path ($wgScriptPath)
{{localurl:pagename}}
{{localurl:pagename|query string}}
/wiki/Pagename
/wiki/index.php?title=Pagename&query string
relative path to title

Page names

Variable Output Description
{{FULLPAGENAME}} Help:Variables Namespace and page title
{{BASEPAGENAME}} Variables The namespace and page title excluding the current subpage ("Title" on "Title/foo")
{{PAGENAME}} Variables Page title
{{SUBPAGENAME}} Variables The subpage title ("foo" on "Title/foo")
{{SUBJECTPAGENAME}} Help:Variables The title of the associated content page.
{{TALKPAGENAME}} Help talk:Variables The title of the associated talk page.

The following are URL-encoded equivalents:

  • {{FULLPAGENAMEE}}
  • {{PAGENAMEE}}
  • {{BASEPAGENAMEE}}
  • {{SUBPAGENAMEE}}
  • {{SUBJECTPAGENAMEE}}
  • {{TALKPAGENAMEE}}

Namespaces

Variable Output Description
{{NAMESPACE}} Help Namespace (name)
{{SUBJECTSPACE}} Help Name of the associated content namespace
{{TALKSPACE}} Help talk Name of the associated talk namespace

The following are URL-encoded equivalents:

  • {{NAMESPACEE}}
  • {{SUBJECTSPACEE}}
  • {{TALKSPACEE}}

{{ns:}} returns the localized namespace name for that number of constant. The default values are:

Usage Output
{{ns:-2}} or {{ns:Media}} Media
{{ns:-1}} or {{ns:Special}} Special
{{ns:0}} or {{ns:Main}}
{{ns:1}} or {{ns:Talk}} Talk
{{ns:2}} or {{ns:User}} User
{{ns:3}} or {{ns:User_talk}} User talk
{{ns:4}} or {{ns:Project}} SuperTux
{{ns:5}} or {{ns:Project_talk}} SuperTux talk
{{ns:6}} or {{ns:Image}} File
{{ns:7}} or {{ns:Image_talk}} File talk
{{ns:8}} or {{ns:MediaWiki}} MediaWiki
{{ns:9}} or {{ns:MediaWiki_talk}} MediaWiki talk
{{ns:10}} or {{ns:Template}} Template
{{ns:11}} or {{ns:Template_talk}} Template talk
{{ns:12}} or {{ns:Help}} Help
{{ns:13}} or {{ns:Help_talk}} Help talk
{{ns:14}} or {{ns:Category}} Category
{{ns:15}} or {{ns:Category_talk}} Category talk

Custom variables

MediaWiki also supports custom variables defined as part of extensions or specific to a particular installation. For example, some installations might find it helpful to have a variable that identifies the name of the sponsoring organization or the portion of the wiki URL that precedes the title if it is liable to change or more complex than http://{{SERVERNAME}}.


For more information, please see Manual:Variables.

External links

MetaWiki: Help:Variable