Help:Variable

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. 

Constant, only depending on the project and parameters
The variable localurl replaces spaces by underscores and special characters by escape codes, e.g. gives. 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 giving, not  giving.

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 "/":


 * fr:Special:Whatlinkshere/Économie de Monaco
 * http://fr.wikipedia.org gives:
 * http://fr.wikipedia.org
 * http://en.wikipedia.org gives:
 * http://en.wikipedia.org

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 variable introduced in recent versions allows the entire link to be specified in one go, without also using. This also means it can be used in the same way for local and interwiki links (it being clearly inappropriate to add 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
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 ("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
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.

  [url=][/url]

  [url=][/url]