This is a copy of the master help page at m:Help:Variable. Do not edit this page. Edits will be lost in the next update from the master page. Either edit the master help page for all projects at Meta, or edit the project-specific text at Template:Ph:Variable. You are welcome to copy the exact wikitext from the master page at Meta and paste it into this page at any time.


Editing overview

Starting a new page

  1. Page name

Referencing

  1. Links
  2. Piped links
  3. Interwiki linking
  4. Variables
  5. URLs
  6. Anchors

Formatting

  1. Formulas
  2. Lists
  3. Tables
  4. HTML in wikitext
  5. Image & File uploads
  6. Image page

Organizing

  1. Sections
  2. Templates
  3. Categories
  4. Redirects
  5. Namespaces
  6. Renaming (moving) a page

Fixing mistakes and vandalism

  1. Reverting edits
  2. Testing

Saving effort

  1. Editing shortcuts
  2. Editing toolbar
  3. Magic words

Communicating

  1. Edit summary
  2. Talk page
  3. Edit conflict
  4. Minor edit

Special characters

  1. Turkish characters
  2. Romanian characters

Extensions

  1. WikiHiero syntax — warning: lots of images! (for Egyptian hieroglyphs)
  2. EasyTimeline syntax

Frequently Asked Questions


This is a list of variables that can be used in the wikitext. The way they are rendered depends on the time, on the project, or on the page in which it occurs.

On the left is the variable, on the right how it is rendered at this time, in this project, on this page.

The names of the variables form part of the set of so-called "magic words" the system uses. [1]

Constant, only depending on the project and parameters

edit
{{ns:-2}} or {{ns:Media}} Media
{{ns:-1}} or {{ns:Special}} Special
{{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}} Wikiquote
{{ns:5}} or {{ns:Project_talk}} Wikiquote 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
depending on custom namespaces:
{{ns:100}}, {{ns:101}}, etc.
, , etc.
{{SITENAME}} Wikiquote
{{SERVER}} //en.wikiquote.org
{{SERVERNAME}} en.wikiquote.org
{{localurl:pagename}} /wiki/Pagename
{{localurle:pagename}} /wiki/Pagename
{{localurl:pagename|query string}} /w/index.php?title=Pagename&query string
{{fullurl:pagename}} //en.wikiquote.org/wiki/Pagename
{{fullurl:pagename|query_string}} //en.wikiquote.org/w/index.php?title=Pagename&query_string
{{int:fromwikipedia}} ⧼fromwikipedia⧽


The variable localurl replaces spaces by underscores and special characters by escape codes, e.g. {{localurl:a é}} gives /wiki/A_%C3%A9. The purposes are:

  • for a given page name, creating a link in external link style to a page in the same project or a project which uses the same string in the URL between the server name and the page name (on Wikimedia "/wiki/" and "w/index.php?title=") (but see also m:Template talk:Pi).
  • allow the same wikitext to be used in a project that uses a different string, if the target is in that other project or a project which uses the same string

The pagename in localurl should not be written with escape codes: e.g. use {{SERVER}}{{localurl:À}} giving //en.wikiquote.org/wiki/%C3%80, not {{SERVER}}{{localurl:%C3%80}} giving //en.wikiquote.org/wiki/%C3%80 .

Note that localurl does not convert page names and user names after "target=". This syntax can be avoided by putting the target in the first part of localurl, after the "/":

Localurle (and its counterpart, fullurle) perform additional character escaping on the resulting link, and are intended for internal use only, and work in wikitext only for backwards-compatibility reasons. The unescaped versions should always be used in wikitext.

The {{fullurl}} variable introduced in recent versions allows the entire link to be specified in one go, without also using {{server}}. This also means it can be used in the same way for local and interwiki links (it being clearly inappropriate to add {{server}} before the latter)

"INT:" is used to get text from the Mediawiki: namespace. If the user's interface language, as specified in Special:Preferences, is the wiki's default language, it will display the contents of Mediawiki:pagename. If the user has selected another language, it will display the contents of Mediawiki:pagename/languagecode (e.g. Mediawiki:fromwikipedia/fr for French) if such a page exists, and of Mediawiki:pagename if it does not. It is short for "internal".

Varying with time

edit
{{CURRENTMNTH}} Template:CURRENTMNTH --One digit when month is below 10 (en.wikipedia only).
{{CURRENTMONTH}} 11 --Two-digit month number.
{{CURRENTMONTHNAME}} November
{{CURRENTMONTHABBREV}} Nov
{{CURRENTMONTHNAMEGEN}} November
{{CURRENTWEEK}} 44
{{CURRENTDAY}} 2 --One digit when day is below 10.
{{CURRENTDAY2}} 02 --Two-digit day of month (en.wikipedia only).
{{CURRENTDAYNAME}} Saturday
{{CURRENTDOW}} 6
{{CURRENTYEAR}} 2024
{{CURRENTTIME}} 11:28
{{NUMBEROFARTICLES}} 53,955

NUMBEROFARTICLES: number of pages in the main namespace which contain a link and are not a redirect, i.e. number of articles, stubs containing a link, and disambiguation pages.

This depends on system variable $wgUseCommaCount If true, article count will only include those with commas (","). If false, will only count those with links ("[["). The default set in DefaultSettings.php is false, this can be changed in LocalSettings.php. See also Help:Article count.

CURRENTWEEK is not supported in earlier versions of MediaWiki. It ranges from 1 to 54.

CURRENTDOW is the day of the week, Monday=1, etc.

CURRENTMONTHNAMEGEN: is the genitive grammatical form of the month name (used in Finnish).

Depending on page

edit
{{NAMESPACE}} Help
{{NAMESPACEE}} Help
{{PAGENAME}} Variable
{{PAGENAMEE}} Variable
{{FULLPAGENAME}} Help:Variable
{{FULLPAGENAMEE}} Help:Variable

PAGENAMEE displays the page title in the form that is used in URLs, i.e. with underscores for spaces, and escape codes for special characters, and is therefore used for constructing URLs. For example, on a page called "Grand café", PAGENAMEE would produce "Grand_caf%C3%A9". Do not use PAGENAMEE as the pagename in first part of the variable localurl, see above. See also Variables PAGENAME and PAGENAMEE

When used in a template, these three variables refer to the page in which the template is included, not to the template page.

<a href= ></a> [url=][/url]

<a href= ></a> [url=][/url]