Help:Magic words: Difference between revisions

From dankwiki
m (1 revision: Project PD: http://www.mediawiki.org/wiki/Project:PD_help/Copying)
 
m (1 revision: Media Wiki help files imported from http://www.mediawiki.org/wiki/Project:PD_help/Copying 2011-06-12)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
See also: [[w:Help:Magic words]] on wikipedia
'''Magic words''' are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page is about usage of standard magic words; for a technical reference, see {{Mediawiki|Manual:Magic words}}.


{{H:h|editor toc}}This is an organized index of Magic words used in MediaWiki.
There are three general types of magic words:
*'''[[#Behavior switches|Behavior switches]]''': these are uppercase words surrounded by double underscores, ''e.g.'' '''__FOO__'''
*'''[[#Variables|Variables]]''': these are uppercase words surrounded by double braces, ''e.g.'' '''<code><nowiki>{{FOO}}</nowiki></code>'''. As such, they look a lot like [[Help:Templates|templates]].
*'''[[#Parser functions|Parser functions]]''': these take parameters and are either of the form '''<code><nowiki>{{foo:...}}</nowiki></code>''' or '''<code><nowiki>{{#foo:...}}</nowiki></code>'''. See also {{mediawiki|Help:Extension:ParserFunctions}}.


A "'''[[w:Magic (programming)|magic]] word'''" is a symbol recognized by the MediaWiki software and which when seen in the non-commented text of the page, triggers the software to do something other than display that symbol, or transclude a page with that name, but instead to use the symbol directly.
Page-dependent magic words will affect or return data about the ''current'' page (by default), even if the word is added through a transcluded template or included system message.
 
A magic word can be:
*a behavior switch, called using an upper case word, preceded and followed by two underscores, e.g. '''<nowiki>__NOTOC__</nowiki>'''
*an [[w:XML|XML]] object, coded similar to HTML, preceded by "<" (and for the end tag "/") and followed by ">", as in '''&lt;nowiki>'''...'''&lt;/nowiki>'''
*a [[help:parser function|parser function]]: similar to a template, a word preceded by the symbols "'''<nowiki>{{</nowiki>'''" and followed by "'''<nowiki>}}</nowiki>'''", and optionally parameter definitions between pipe characters, except that the part before the first pipe (or without pipes, the text between the braces) contains a colon ("''':'''"), e.g. <nowiki>{{</nowiki>'''ns:'''3}} and {{'''#ifexpr:'''<nowiki>{{{1}}}>3|large|small}}</nowiki>
*a [[help:variable|variable]]: similar to a template without parameters, a word preceded by the symbols "'''<nowiki>{{</nowiki>'''" and followed by "'''<nowiki>}}</nowiki>'''", except the word used is in all upper case, e.g. '''<nowiki>{{CURRENTDAY}}</nowiki>''' 
*a template modifier
*an image modifier
 
If a page in the template namespace has the same name as a magic word, the magic word will be invoked instead.  If you discover you absolutely have to define a template with the same name as a magic word, prefix the name of the template with "'''msg:'''" or the name of the template namespace ("'''Template:'''").  See below for further details if you need this feature.
 
Tags which are used on this page such as "'''[MW1.5+]'''" indicate the [[w:MediaWiki|MediaWiki]] version that first supported the magic word. "XYZ" indicates user input, which is used in the example.


==Behavior switches==
==Behavior switches==
A behavior switch is a directive to the page software to include or omit certain elements of the page interface, or otherwise constitutes a call to various parts of the pages standard layout. It is characterised by capitalised identifiers with double underscores either side.
A behavior switch controls the layout or behaviour of the page and can often be used to specify desired omissions and inclusions in the content.


=== Table of contents ===
{| class="wikitable"
:''For details see [[Help:Section]]''  
|-
{{H:TOC variables}}<br clear="left" />
! {{Hl2}}| Word
 
! {{Hl2}}| Description
=== Other ===
! {{Hl2}}| Versions
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" width="79%"
|-
! Word
! {{Hl3}} colspan="3"| '''Table of contents'''
! Explanation
|-
| <code><nowiki>__NOTOC__</nowiki></code>
| Hides the table of contents (TOC).
|
|-
| <code><nowiki>__FORCETOC__</nowiki></code>
| Forces the table of content to appear at its normal position (above the first header).
|
|-
|-
| <nowiki>__NOEDITSECTION__</nowiki>
| <code><nowiki>__TOC__</nowiki></code>
| Hides the edit links beside headings. Also, will no longer automatically edit only one section at a time when double- or right-clicking a heading (if you have that feature enabled in your preferences)
| Places a table of contents at the word's current position (overriding <code><nowiki>__NOTOC__</nowiki></code>). If this is used multiple times, the table of contents will appear at the first word's position.
|
|-
|-
| <nowiki>__NEWSECTIONLINK__</nowiki>
! {{Hl3}} colspan="3"| '''Editing'''
| '''[MW1.7+]''' Gives a "+"-link next to the edit-tab to make a new section on a non-talk page ([[Help:Section#Adding_a_section_at_the_end|post-a-comment feature]]).
|-
|-
| <nowiki>__NOCONTENTCONVERT__</nowiki><br /><nowiki>__NOCC__</nowiki>
| <code><nowiki>__NOEDITSECTION__</nowiki></code>
| Don't perform the content language conversion  (character and phase) in article display; for example, Chinese zh with zh_cn, zh_tw, zh_sg, zh_hk.
| Hides the section edit links beside headings.
|
|-
|-
| <nowiki>__NOGALLERY__</nowiki>
| <code><nowiki>__NEWSECTIONLINK__</nowiki></code>
| '''[MW1.7+]''' This magic word allows images in category pages to be displayed as inline links instead of gallery.
| Adds a link ([[MediaWiki:Addsection|"+" by default]]) beside the "edit" tab for adding a new section on a non-talk page (see {{mediawiki|m:Help:Section#Adding a section at the end|Adding a section to the end}}).
| 1.7+
|-
|-
| <nowiki>__NOTITLECONVERT__</nowiki><br /><nowiki>__NOTC__</nowiki>
| <code><nowiki>__NONEWSECTIONLINK__</nowiki></code>
| Like <nowiki>__NOCC__</nowiki> but affecting article title only.
| Removes the link beside the "edit" tab on pages in talk namespaces.
| {{mediawiki|rev:47522|1.15+}}
|-
|-
| <nowiki>__END__</nowiki>
! {{Hl3}} colspan="3"| '''Categories'''
| Allows for trailing whitespace to be included in the page save. Removed in [[rev:19213|19213]].
|-
|-
| <nowiki>__START__</nowiki>
| <code><nowiki>__NOGALLERY__</nowiki></code>
| This magic word has no effect but an ID in <tt>MagicWord.php</tt> (<code>MAG_START</code>).
| Used on a category page, replaces thumbnails in the category view with normal links.
| 1.7+
|-
|-
| <nowiki>__HIDDENCAT__</nowiki>
| <code><nowiki>__HIDDENCAT__</nowiki></code>
| '''[MW1.13+]''' When placed anywhere on a category page, this magic word causes that category not to appear in the horizontal box near the bottom of  every member page. See [[Help:Category#Hidden_categories]] for further detail.
| Used on a category page, hides the category from the lists of categories in its members and parent categories (there is an option in the [[Help:Preferences|user preferences]] to show them).<!-- hiddencategory hiddencat hide category categories -->
|-
| 1.13+
|  <nowiki>__NOINDEX__</nowiki>
| '''[MW1.13+]'''<!--r37973--> Search engines won't index the page.
|-
|-
|  <nowiki>__INDEX__</nowiki>
! {{Hl3}} colspan="3"| '''Language conversion'''
| '''[MW1.13+]''' Search engines will index the page. (Overrides [[mw:Manual:$wgArticleRobotPolicies|$wgArticleRobotPolicies]], but not robots.txt.)
|-
|-
| <nowiki>__STATICREDIRECT__</nowiki>
| <code><nowiki>__NOCONTENTCONVERT__</nowiki></code> <br /> <code><nowiki>__NOCC__</nowiki></code>
| '''[MW1.13+]'''<!--r37928--> Redirects marked with this will not be fixed when someone moves a page and checks "Update any redirects that point to the original title".
| On wikis with language variants, don't perform any content language conversion (character and phase) in article display; for example, only show Chinese (zh) instead of variants like zh_cn, zh_tw, zh_sg, or zh_hk.
|}<br clear="left" />
|
 
== Variables ==
:''For details see [[Help:Variable]]''
 
===Time===
The time in [[:en:UTC|UTC]].  Note that if the page was displayed by the same user and has not changed (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.
{| class="wikitable sortable" border="2" cellpadding="4" cellspacing="0"
! Word
! class="unsortable" | Example
! class="unsortable" | Explanation
|-
|-
| <nowiki>{{CURRENTDAY}}</nowiki>
| <code><nowiki>__NOTITLECONVERT__</nowiki></code> <br /> <code><nowiki>__NOTC__</nowiki></code>
| <code>{{CURRENTDAY}}</code>
| On wikis with language variants, don't perform language conversion on the title (all other content is converted).
| Displays the current day in numeric form.
|
|-
|-
| <nowiki>{{CURRENTDAY2}}</nowiki>
! {{Hl3}} colspan="3"| '''Other'''
| <code>{{CURRENTDAY2}}</code>
| '''[MW1.6+]''' Same as <nowiki>{{CURRENTDAY}}</nowiki>, but with leading zero (01 .. 31).
|-
|-
| <nowiki>{{CURRENTDAYNAME}}</nowiki>
| <code><nowiki>__START__</nowiki></code>
| <code>{{CURRENTDAYNAME}}</code>
| No effect.
| Name of the day in the language of the project or English.
|
|-
|-
| <nowiki>{{CURRENTDOW}}</nowiki>
| <code><nowiki>__END__</nowiki></code>
| <code>{{CURRENTDOW}}</code>
| Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in {{mediawiki|rev:19213|19213}}.
| Same as <nowiki>{{CURRENTDAYNAME}}</nowiki>, but as a number (0=Sunday, 1=Monday...).
| 1.1–1.8
|-
|-
| <nowiki>{{CURRENTMONTH}}</nowiki>
| <code><nowiki>__INDEX__</nowiki></code>
| <code>{{CURRENTMONTH}}</code>
| Tell search engines to index the page (overrides {{mediawiki|Manual:$wgArticleRobotPolicies|$wgArticleRobotPolicies}}, but not robots.txt).
| The number 01 .. 12 of the month.
| 1.14+
|-
| <code><nowiki>__NOINDEX__</nowiki></code>
| Tell search engines not to index the page (ie, do not list in search engines' results).
| {{mediawiki|rev:37973|1.14+}}
|-
|-
| <nowiki>{{CURRENTMONTHABBREV}}</nowiki>
| <code><nowiki>__STATICREDIRECT__</nowiki></code>
| <code>{{CURRENTMONTHABBREV}}</code>
| On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "Update any redirects that point to the original title".
| '''[MW1.5+]''' Same as <nowiki>{{CURRENTMONTH}}</nowiki>, but in abbreviated form (Jan .. Dec).
| {{mediawiki|rev:37928|1.13+}}
|}
 
==Variables==
Variables return information about the current page, wiki, or date. Their syntax is similar to [[Help:Templates|templates]]. Variables marked as "<span style="background:#FED;">'''[expensive]'''</span>" are tracked by the software, and the number that can be included on a page is limited.
 
If a template name conflicts with a variable, the variable will be used (so to transclude the template [[{{ns:10}}:PAGENAME]] you would need to write <code><nowiki>{{</nowiki>{{ns:10}}:PAGENAME<nowiki>}}</nowiki></code>). In some cases, adding parameters will force the parser to invoke a template; for example, <code><nowiki>{{CURRENTDAYNAME|x}}</nowiki></code> transcludes [[{{ns:10}}:CURRENTDAYNAME]] ''not'' the variable.
 
===Date and time===
The following variables return the current date and time in UTC.
 
Due to MediaWiki and browser caching, these variables frequently show when the page was ''cached'' rather than the current time.
 
{| class="wikitable"
|-
|-
| <nowiki>{{CURRENTMONTHNAME}}</nowiki>
! {{Hl2}}| Variable
| <code>{{CURRENTMONTHNAME}}</code>
! {{Hl2}}| Output
| Same as <nowiki>{{CURRENTMONTH}}</nowiki>, but in named form (January .. December).
! {{Hl2}}| Description
! {{Hl2}}| Versions
|-
|-
| <nowiki>{{CURRENTTIME}}</nowiki>
! {{Hl3}} colspan="4"| '''Year'''
| <code>{{CURRENTTIME}}</code>
| The current time (00:00 .. 23:59).
|-
|-
| <nowiki>{{CURRENTHOUR}}</nowiki>
| <code><nowiki>{{CURRENTYEAR}}</nowiki></code>
| <code>{{CURRENTHOUR}}</code>
| {{CURRENTYEAR}}
| The current hour (00 .. 23).
| Year
|
|-
|-
| <nowiki>{{CURRENTWEEK}}</nowiki>
! {{Hl3}} colspan="4"| '''Month'''
| <code>{{CURRENTWEEK}}</code>
| Number of the current week (1-53) according to [[w:en:ISO 8601|ISO 8601]] with no leading zero.
|-
|-
| <nowiki>{{CURRENTYEAR}}</nowiki>
| <code><nowiki>{{CURRENTMONTH}}</nowiki></code>  
| <code>{{CURRENTYEAR}}</code>
| {{CURRENTMONTH}}
| Returns the current year.
| Month (zero-padded number)
|
|-
|-
| <nowiki>{{CURRENTTIMESTAMP}}</nowiki>
| <code><nowiki>{{CURRENTMONTHNAME}}</nowiki></code>
| <code>{{CURRENTTIMESTAMP}}</code>
| {{CURRENTMONTHNAME}}
| '''[MW1.7+]''' [[w:en:ISO 8601|ISO 8601]] time stamp.
| Month (name)
|}{{-}}
|
 
|-
===Local time===
| <code><nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki></code>
The time depending on the local timezone of the wiki (''not'' depending on the timezone in the user's preference settings). (All words '''[MW1.8+]''' )
| {{CURRENTMONTHNAMEGEN}}
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"
| Month ([[wikipedia:genitive|genitive form]])
! Word
|
! Example
! Explanation
|-
|-
| <nowiki>{{LOCALDAY}}</nowiki>
| <code><nowiki>{{CURRENTMONTHABBREV}}</nowiki></code>
| <code>{{LOCALDAY}}</code>
| {{CURRENTMONTHABBREV}}
| Displays the local day of the month in numeric form.
| Month (abbreviation)
| 1.5+
|-
|-
| <nowiki>{{LOCALDAY2}}</nowiki>
! {{Hl3}} colspan="4"| '''Day'''
| <code>{{LOCALDAY2}}</code>
| Same as <nowiki>{{LOCALDAY}}</nowiki>, but with a leading zero (01 .. 31).
|-
|-
| <nowiki>{{LOCALDAYNAME}}</nowiki>
| <code><nowiki>{{CURRENTDAY}}</nowiki></code>
| <code>{{LOCALDAYNAME}}</code>
| {{CURRENTDAY}}
| Name of the day in the language of the project or English.
| Day of the month (unpadded number)
|
|-
|-
| <nowiki>{{LOCALDOW}}</nowiki>
| <code><nowiki>{{CURRENTDAY2}}</nowiki></code>
| <code>{{LOCALDOW}}</code>
| {{CURRENTDAY2}}
| Same as <nowiki>{{LOCALDAYNAME}}</nowiki>, but as a number (0=Sunday, 1=Monday...).
| Day of the month (zero-padded number)
| 1.6+
|-
|-
| <nowiki>{{LOCALMONTH}}</nowiki>
| <code><nowiki>{{CURRENTDOW}}</nowiki></code>
| <code>{{LOCALMONTH}}</code>
| {{CURRENTDOW}}
| The number 01 .. 12 of the month.
| Day of the week (unpadded number)
|
|-
|-
| <nowiki>{{LOCALMONTHABBREV}}</nowiki>
| <code><nowiki>{{CURRENTDAYNAME}}</nowiki></code>
| <code>{{LOCALMONTHABBREV}}</code>
| {{CURRENTDAYNAME}}
| Same as <nowiki>{{LOCALMONTH}}</nowiki>, but in abbreviated form as Jan .. Dec.
| Day of the week (name)
|
|-
|-
| <nowiki>{{LOCALMONTHNAME}}</nowiki>
! {{Hl3}} colspan="4"| '''Time'''
| <code>{{LOCALMONTHNAME}}</code>
| Same as <nowiki>{{LOCALMONTH}}</nowiki>, but in named form as January .. December.
|-
|-
| <nowiki>{{LOCALTIME}}</nowiki>
| <code><nowiki>{{CURRENTTIME}}</nowiki></code>
| <code>{{LOCALTIME}}</code>
| {{CURRENTTIME}}
| The local time (00:00 .. 23:59).
| Time (24-hour HH:mm format)
|
|-
|-
| <nowiki>{{LOCALHOUR}}</nowiki>
| <code><nowiki>{{CURRENTHOUR}}</nowiki></code>
| <code>{{LOCALHOUR}}</code>
| {{CURRENTHOUR}}
| The local hour (00 .. 23).
| Hour (24-hour zero-padded number)
|
|-
|-
| <nowiki>{{LOCALWEEK}}</nowiki>
! {{Hl3}} colspan="4"| '''Other'''
| <code>{{LOCALWEEK}}</code>
| Number of the local week (1-53) according to [[w:en:ISO 8601|ISO 8601]] with no leading zero.
|-
|-
| <nowiki>{{LOCALYEAR}}</nowiki>
| <code><nowiki>{{CURRENTWEEK}}</nowiki></code>
| <code>{{LOCALYEAR}}</code>
| {{CURRENTWEEK}}
| Returns the local year.
| Week (number)
|
|-
|-
| <nowiki>{{LOCALTIMESTAMP}}</nowiki>
| <code><nowiki>{{CURRENTTIMESTAMP}}</nowiki></code>
| <code>{{LOCALTIMESTAMP}}</code>
| {{CURRENTTIMESTAMP}}
| [[w:en:ISO 8601|ISO 8601]] time stamp.
| YYYYMMDDHHmmss timestamp
|}{{-}}
| 1.7+
|}


*See also:
The following variables do the same as the above, but using the site's server config or $wgLocaltimezone.
**[[mw:Help:ParserFunctions|Help:ParserFunctions]]
* <code><nowiki>{{LOCALYEAR}}</nowiki></code>
**{{tl|now}} for a [[w:W3C|W3C]] draft standard compliant date and time.
* <code><nowiki>{{LOCALMONTH}}</nowiki></code>
* <code><nowiki>{{LOCALMONTHNAME}}</nowiki></code>
* <code><nowiki>{{LOCALMONTHNAMEGEN}}</nowiki></code>
* <code><nowiki>{{LOCALMONTHABBREV}}</nowiki></code>
* <code><nowiki>{{LOCALDAY}}</nowiki></code>
* <code><nowiki>{{LOCALDAY2}}</nowiki></code>
* <code><nowiki>{{LOCALDOW}}</nowiki></code>
* <code><nowiki>{{LOCALDAYNAME}}</nowiki></code>
* <code><nowiki>{{LOCALTIME}}</nowiki></code>
* <code><nowiki>{{LOCALHOUR}}</nowiki></code>
* <code><nowiki>{{LOCALWEEK}}</nowiki></code>
* <code><nowiki>{{LOCALTIMESTAMP}}</nowiki></code>


=== Statistics ===
:''For more thorough time formatting, you may want to install [[Extension:ParserFunctions]] to use the [[Help:Extension:ParserFunctions#.23time|#time parser function]]''
Statistics variables give thousands separators unless ":R" for "raw" is added (actually, these versions are parser functions). When using these magic words in expressions, :R or |R is required. Without the :R or |R, an error will occur if the returned number is greater than 999 since the commas will interfere with the calculation.


{| class="wikitable" border="2" cellpadding="4" cellspacing="0"
===Technical metadata===
! Word
''Note:'' Revision variables return data about the '''latest edit to the current page''', even if viewing an older version of the page.
! Example
{| class="wikitable"
! Explanation
|-
|-
| <nowiki>{{CURRENTVERSION}}</nowiki>
! {{Hl2}}| Variable
| <code>{{CURRENTVERSION}}</code>
! {{Hl2}}| Output
| '''[MW1.7+]''' {{h:mwg|Version}} [http://mail.wikipedia.org/pipermail/mediawiki-i18n/2006-May/000026.html]
! {{Hl2}}| Description
! {{Hl2}}| Versions
|-
|-
|<nowiki>{{NUMBEROFEDITS}}</nowiki><br /><nowiki>{{NUMBEROFEDITS:R}}</nowiki>
! {{Hl3}} colspan="4"| '''Site'''
| <code>{{NUMBEROFEDITS}}</code><br /><code>{{NUMBEROFEDITS:R}}</code>
| '''[MW1.10+ (r21319)]''' Returns the total number of page edits since MediaWiki, the software that runs this site, was installed.
|-
|-
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br /><nowiki>{{NUMBEROFARTICLES:R}}</nowiki>
| <code><nowiki>{{SITENAME}}</nowiki></code>
| <code>{{NUMBEROFARTICLES}}</code><br /><code>{{NUMBEROFARTICLES:R}}</code>
| {{SITENAME}}
| A [[Help:Variable|variable]] which returns the total number of articles on the Wiki. See [[mw:Manual:Article]] for information on what constitutes an article.
| The wiki's site name ({{mediawiki|Manual:$wgSitename|$wgSitename}}).
|
|-
|-
| <nowiki>{{NUMBEROFPAGES}}</nowiki><br /><nowiki>{{NUMBEROFPAGES:R}}</nowiki>
| <code><nowiki>{{SERVER}}</nowiki></code>
| <code>{{NUMBEROFPAGES}}</code><br /><code>{{NUMBEROFPAGES:R}}</code>
| {{SERVER}}
| '''[MW1.7+]''' Returns the total number of pages. [http://mail.wikipedia.org/pipermail/mediawiki-i18n/2006-May/000026.html]
| domain URL ({{mediawiki|Manual:$wgServer|$wgServer}})
|
|-
|-
| <nowiki>{{NUMBEROFFILES}}</nowiki><br /><nowiki>{{NUMBEROFFILES:R}}</nowiki>
| <code><nowiki>{{SERVERNAME}}</nowiki></code>
| <code>{{NUMBEROFFILES}}</code><br /><code>{{NUMBEROFFILES:R}}</code>
| {{SERVERNAME}}
| '''[MW1.5+]''' Returns the number of uploaded files (rows in the image table).
| domain name (No longer dependent on {{mediawiki|Manual:$wgServerName|$wgServerName}} as of version 1.17)
|
|-
|-
| <nowiki>{{NUMBEROFUSERS}}</nowiki><br /><nowiki>{{NUMBEROFUSERS:R}}</nowiki>
| <code><nowiki>{{DIRMARK}}</nowiki></code><br /><code><nowiki>{{DIRECTIONMARK}}</nowiki></code>
| <code>{{NUMBEROFUSERS}}</code><br /><code>{{NUMBEROFUSERS:R}}</code>
| {{DIRMARK}}<br />{{DIRECTIONMARK}}
| '''[MW1.7+]''' Returns the number of registered users (rows in the user table).
| Outputs a unicode-directional mark that matches the wiki's default language's direction (<code>&amp;lrm;</code> on left-to-right wikis, <code>&amp;rlm;</code> on right-to-left wikis), useful in text with multi-directional text.
| 1.7+
|-
|-
| <nowiki>{{NUMBEROFACTIVEUSERS}}</nowiki><br /><nowiki>{{NUMBEROFACTIVEUSERS:R}}</nowiki>
| <code><nowiki>{{SCRIPTPATH}}</nowiki></code>
| <code>{{NUMBEROFACTIVEUSERS}}</code><br /><code>{{NUMBEROFACTIVEUSERS:R}}</code>
| {{SCRIPTPATH}}
| '''[MW1.15+]''' Returns the number of active users (registered users who have performed an action in the last 30 days).
| relative script path ({{mediawiki|Manual:$wgScriptPath|$wgScriptPath}})
|
|-
|-
| <nowiki>{{NUMBEROFADMINS}}</nowiki><br /><nowiki>{{NUMBEROFADMINS:R}}</nowiki>
| <code><nowiki>{{STYLEPATH}}</nowiki></code>
| <code>{{NUMBEROFADMINS}}</code><br /><code>{{NUMBEROFADMINS:R}}</code>
| {{STYLEPATH}}
| '''[MW1.7+]''' Returns the number of administrators (users in the ''sysop'' group).
| relative style path ({{mediawiki|Manual:$wgStylePath|$wgStylePath}})
| 1.16+
|-
|-
| <nowiki>{{NUMBERINGROUP:groupname}}</nowiki><br /><nowiki>{{NUMBERINGROUP:groupname|R}}</nowiki>
| <code><nowiki>{{CURRENTVERSION}}</nowiki></code>
| <nowiki>{{NUMBERINGROUP:bureaucrat}}</nowiki><br /><nowiki>{{NUMBERINGROUP:bureaucrat|R}}</nowiki><br />(returns {{NUMBERINGROUP:bureaucrat}})
| {{CURRENTVERSION}}
| '''[MW1.14+]''' Returns the number of users in a specific group.
| The wiki's MediaWiki version.
| 1.7+
|-
|-
| <nowiki>{{PAGESINNAMESPACE}}</nowiki>
| <code><nowiki>{{CONTENTLANGUAGE}}</nowiki></code><br /><code><nowiki>{{CONTENTLANG}}</nowiki></code>
| &#160;{{#if:{{#ifexpr:{{PAGEINNS:0|R}}}}|<font color="red">'''disabled here'''</font>}}
| {{CONTENTLANGUAGE}}<br />{{CONTENTLANG}}
| Longer alias of PAGESINNS
| The wiki's default interface language ({{mediawiki|Manual:$wgLanguageCode|$wgLanguageCode}})
| 1.7+
|-
|-
| <nowiki>{{PAGESINNS:ns}}</nowiki><br /><nowiki>{{PAGESINNS:ns|R}}</nowiki>
! {{Hl3}} colspan="4"| '''Latest revision to current page'''
| <nowiki>{{PAGESINNS:2}}</nowiki>&#160;{{#if:{{#ifexpr:{{PAGEINNS:0|R}}}}||=&#160;<tt>{{PAGESINNS:2}}</tt>}}<br /><nowiki>{{PAGESINNS:2|R}}</nowiki>&#160;{{#if:{{#ifexpr:{{PAGEINNS:0|R}}}}|<br /><font color="red">'''disabled here'''</font>|=&#160;<tt>{{PAGESINNS:2|R}}</tt>}}
|-
| '''[MW1.7+]''' Returns the number of pages in the given namespace. Disabled by default, enable with {{h:mwg|AllowSlowParserFunctions}}.
| <code><nowiki>{{REVISIONID}}</nowiki></code>
|}{{-}}
| {{REVISIONID}}
| Unique revision ID
| 1.5+
|-
| <code><nowiki>{{REVISIONDAY}}</nowiki></code>
| {{REVISIONDAY}}
| Day edit was made (unpadded number)
| 1.8+
|-
| <code><nowiki>{{REVISIONDAY2}}</nowiki></code>
| {{REVISIONDAY2}}
| Day edit was made (zero-padded number)
| 1.8+
|-
| <code><nowiki>{{REVISIONMONTH}}</nowiki></code>
| {{REVISIONMONTH}}
| Month edit was made (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions)
| 1.8+
|-
| <code><nowiki>{{REVISIONYEAR}}</nowiki></code>
| {{REVISIONYEAR}}
| Year edit was made
| 1.8+
|-
| <code><nowiki>{{REVISIONTIMESTAMP}}</nowiki></code>
| {{REVISIONTIMESTAMP}}
| Timestamp as of time of edit
| 1.8+
|-
| <code><nowiki>{{REVISIONUSER}}</nowiki></code>
| {{REVISIONUSER}}
| The username of the user who made the most recent edit to the page, or the current user when previewing an edit
| {{mediawiki|rev:48149|1.15+}}
|-style="background:#FED;"
| <code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>}}</nowiki></code><br /><code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>|R}}</nowiki>
| {{PAGESIZE:Help:Magic_words}}<br />{{PAGESIZE:Help:Magic_words|R}}
| '''[expensive]''' Returns the byte size of the specified page. Use "<code><nowiki>|R</nowiki></code>" to get raw numbers.
| {{mediawiki|rev:33551|1.13+}}
|-
| <code><nowiki>{{PROTECTIONLEVEL:</nowiki>''action''<nowiki>}}</nowiki></code>
| protection level
| Outputs the protection level (e.g. 'autoconfirm', 'sysop') for a given action (e.g. 'edit', 'move') on the current page or an empty string if not protected.
| {{mediawiki|rev:45587|1.15+}}
|-
! {{Hl3}} colspan="4"| '''Affects page content'''
|-
| <code><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></code>
|
| Format the current page's title header. The value must be equivalent to the default title: only capitalization changes and replacing spaces with underscores. It can be disabled or enabled by {{mediawiki|Manual:$wgAllowDisplayTitle|$wgAllowDisplayTitle}}; disabled by default before 1.10+, enabled by default thereafter.
| 1.7+
|-
| <code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></code><br /><code><nowiki>{{DEFAULTSORTKEY:</nowiki>''sortkey''<nowiki>}}</nowiki></code><br /><code><nowiki>{{DEFAULTCATEGORYSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></code>
|
| Used for categorizing pages, sets a default [[Help:Categories|category sort key]]. For example if you put <code><nowiki>{{DEFAULTSORT:Smith, John}}</nowiki></code> at the end of [[John Smith]], the page would be sorted under "S" by default in categories.
| 1.10+
|}


=== Page names and related info ===
===Statistics===
{{H:Page name variables}}
Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code> &rarr; {{NUMBEROFPAGES}} and <code><nowiki>{{NUMBEROFPAGES:R}}</nowiki></code> &rarr; {{NUMBEROFPAGES:R}}). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example <code><nowiki>{{PAGESINCATEGORY:Help}}</nowiki></code> and <code><nowiki>{{PAGESINCATEGORY:Help|R}}</nowiki></code>). Also applicable to <code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>}}</nowiki></code> above.
 
{| class="wikitable"
===Other===
|-
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"
! {{Hl2}}| Variable
! Word
! {{Hl2}}| Output
! Example
! {{Hl2}}| Description
! Example results
! {{Hl2}}| Versions
! Explanation
|-
! {{Hl3}} colspan="4"| '''Entire wiki'''
|-
| <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code>
| {{NUMBEROFPAGES}}
| Number of wiki pages.
| 1.7+
|-
| <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code>
| {{NUMBEROFARTICLES}}
| Number of pages in {{mediawiki|Manual:Using custom namespaces#Content namespaces|content namespaces}}.
|
|-
|-
| <nowiki>{{PAGESINCATEGORY:category}}</nowiki><br/><nowiki>{{PAGESINCATEGORY:category|R}}</nowiki>
| <code><nowiki>{{NUMBEROFFILES}}</nowiki></code>
| <code><nowiki>{{PAGESINCATEGORY:User en}}</nowiki></code><br/><code><nowiki>{{PAGESINCATEGORY:User en|R}}</nowiki></code>
| {{NUMBEROFFILES}}
| <code>{{PAGESINCATEGORY:User en}}</code><br/><code>{{PAGESINCATEGORY:User en|R}}</code>
| Number of uploaded files.
| '''[MW1.13+, [[rev:32932|r32932]]]''' Returns the number of pages in a given category, including sub-category pages and file description pages. Does not count pages that are ''within'' subcategories.
| 1.5+
|-
|-
| <nowiki>{{PAGESINCAT:category}}</nowiki><br/><nowiki>{{PAGESINCAT:category|R}}</nowiki>
| <code><nowiki>{{NUMBEROFEDITS}}</nowiki></code>
| <code><nowiki>{{PAGESINCAT:User en}}</nowiki></code><br/><code><nowiki>{{PAGESINCAT:User en|R}}</nowiki></code>
| {{NUMBEROFEDITS}}
| <code>{{PAGESINCAT:User en}}</code><br/><code>{{PAGESINCAT:User en|R}}</code>
| Number of page edits.
| '''[MW1.13+]''' Alias of PAGESINCATEGORY.
| {{mediawiki|rev:21319|1.10+}}
|-
|-
| <nowiki>{{PAGESIZE:page}}</nowiki><br/><nowiki>{{PAGESIZE:page|R}}</nowiki>
| <code><nowiki>{{NUMBEROFVIEWS}}</nowiki></code>
| <code><nowiki>{{PAGESIZE:Help:Magic_words}}</nowiki></code><br/><code><nowiki>{{PAGESIZE:Help:Magic_words|R}}</nowiki></code>
| {{NUMBEROFVIEWS}}
| <code>{{PAGESIZE:Help:Magic_words}}</code><br/><code>{{PAGESIZE:Help:Magic_words|R}}</code>
| Number of page views. Usually useless on a wiki using [[Manual:Cache|caching]].
| '''[MW1.13+ [[rev:33551|r33551]]]''' Returns the byte size of the specified page.
| {{mediawiki|rev:42721|1.14+}}
|-
|-
| <nowiki>{{GENDER:username|TEXTIFMALE|TEXTIFFEMALE|TEXTIFUNSPECIFIED}}</nowiki>
| <code><nowiki>{{NUMBEROFUSERS}}</nowiki></code>
| <code><nowiki>{{GENDER:Anonymous Dissident|he|she|it}}</nowiki></code>
| {{NUMBEROFUSERS}}
| <code>{{GENDER:Anonymous Dissident|he|she|it}}</code>
| Number of registered users.
| Returns an output dependant on a given user's gender, as set in the user's myprefs.
| 1.7+
|}{{-}}
 
==Parser functions==
 
:''For details see [[Help:Parser function]].''
 
=== Namespaces and URLs ===
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"
! Word
! Example
! Explanation
|-
|-
| <nowiki>{{ns:}}</nowiki>
| <code><nowiki>{{NUMBEROFADMINS}}</nowiki></code>
| <nowiki>{{ns:4}}</nowiki> = <code>{{ns:4}}</code><br /><nowiki>{{ns:project}}</nowiki> = <code>{{ns:project}}</code>
| {{NUMBEROFADMINS}}
| Returns the local name of a given [[Help:Namespace|namespace number]].
| Number of users in the ''sysop'' {{mediawiki|Manual:User rights|group}}.
| 1.7+
|-
|-
| <nowiki>{{localurl:x y @}}</nowiki><br /><nowiki>{{localurle:x y @}}</nowiki><br /><nowiki>{{localurl:a|b=c}}</nowiki><br /><nowiki>{{localurl:Wikipedia:Category}}</nowiki>
| <code><nowiki>{{NUMBEROFACTIVEUSERS}}</nowiki></code>
| <code>{{localurl:x y @}}<br />{{localurle:x y @}}<br />{{localurl:a|b=c}}<br />{{localurl:Wikipedia:Category}}</code>
| {{NUMBEROFACTIVEUSERS}}
| Returns the local URL of a page (might not exist). Optional ''query'' parameter, see [[Help:Variable]].
| Number of active users, based on the criteria used in [[Special:Statistics]].
|- <!-- intentionally nbsp instead of sp for formatting reasons -->
| {{mediawiki|rev:47392|1.15+}}
| <nowiki>{{urlencode:x&#160;y&#160;@}}</nowiki>
|-style="background:#FED;"
| <code>{{urlencode:x y @}}</code>
| <code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>}}</nowiki></code><br /><code><nowiki>{{PAGESINCAT:Help}}</nowiki></code>
| '''[MW1.7+]''' Encodes variable values for use in external links.  [http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=14273]
| {{PAGESINCATEGORY:Help}}<br />{{PAGESINCAT:Help}}
|- <!-- intentionally nbsp instead of sp for formatting reasons -->
| '''[expensive]''' Number of pages in the given [[Help:Categories|category]].
| <nowiki>{{anchorencode:x&#160;#y&#160;@}}</nowiki>
| {{mediawiki|rev:32932|1.13+}}
| <code>{{anchorencode:x #y @}}</code>
| '''[MW1.8+]''' Encodes variable values for use in section anchors. [http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=16279]
|-
|-
| <nowiki>{{fullurl:x y @}}</nowiki><br /><nowiki>{{fullurle:x y @}}</nowiki><br /><nowiki>{{fullurl:m:a|b=c}}</nowiki>
| <code><nowiki>{{NUMBERINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code><br /><code><nowiki>{{NUMINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code>
| <small>{{fullurl:x y @}}<br />{{fullurle:x y @}}<br />{{fullurl:m:a|b=c}}</small>
| {{NUMBERINGROUP:bureaucrat}}<br />{{NUMINGROUP:bureaucrat}}<br /><small><nowiki>({{NUMBERINGROUP:bureaucrat}} used here)</nowiki></small>
| '''[MW1.5+]''' Returns the full URL of a given page. Optional ''query'' parameter as for <tt>localurl:</tt>.
| Number of users in a specific {{mediawiki|Manual:User rights|group}}.
| {{mediawiki|rev:40116|1.14+}}
|-
|-
| <nowiki>{{filepath:</nowiki>''file name''<nowiki>}}</nowiki><br /><nowiki>{{filepath:file name|nowiki}}</nowiki>
| <code><nowiki>{{PAGESINNS:</nowiki>''index''<nowiki>}}</nowiki></code><br /><code><nowiki>{{PAGESINNAMESPACE:</nowiki>''index''<nowiki>}}</nowiki></code>
| {{filepath:Wiki.png}}<br />{{filepath:Wiki.png|nowiki}}
| ''not enabled''
| '''[MW1.?+ r25854+]''' Returns the absolute path to image or media file.
| Number of pages in the given [[Help:Namespaces|namespace]] (replace ''index'' with the relevant [[Manual:Namespace|namespace index]]). For instance, <code><nowiki>{{PAGESINNAMESPACE:</nowiki>''14''<nowiki>}}</nowiki></code> will output the number of category pages. <code><nowiki>{{PAGESINNS:0}}</nowiki></code> differs from <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code> in that the former includes redirects and disambiguation pages. Disabled by default, enable with {{mediawiki|Manual:$wgAllowSlowParserFunctions|$wgAllowSlowParserFunctions}}.
|}{{-}}
| 1.7+
|}


=== Formatting ===
===Page names===
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" width="100%"
{| class="wikitable"
! Word
! Example
! Explanation
|-
|-
| <nowiki>{{#language:}}</nowiki>
! {{Hl2}}| Variable
| <nowiki>{{#language:da}}</nowiki> = <code>{{#language:da}}</code>
! {{Hl2}}| Output
| '''[MW1.7+]''' Native name of language code.
! {{Hl2}}| Description
! {{Hl2}}| Versions
|-
|-
| <nowiki>{{#special:}}</nowiki>
| <code><nowiki>{{FULLPAGENAME}}</nowiki></code>
| <nowiki>{{#special:userlogin}}</nowiki> = <code>{{#special:userlogin}}</code>
| {{FULLPAGENAME}}
| '''[MW1.? r17321+]''' Local name of canonical Special: page.
| Namespace and page title.
| 1.6+
|-
|-
| <nowiki>{{lc:}}</nowiki>
| <code><nowiki>{{PAGENAME}}</nowiki></code>
| <nowiki>{{lc:AbC dEf}}</nowiki> = <code>{{lc:AbC dEf}}</code>
| {{PAGENAME}}
| '''[MW1.5+]''' LowerCase
| Page title.
|
|-
|-
| <nowiki>{{lcfirst:}}</nowiki>
| <code><nowiki>{{BASEPAGENAME}}</nowiki></code>
| <nowiki>{{lcfirst:Ab Cd}}</nowiki> = <code>{{lcfirst:Ab Cd}}</code>
| {{BASEPAGENAME}}
| '''[MW1.5+]''' LowerCase first char.
| Page title excluding the current [[Help:Subpages|subpage]] and namespace ("Title/foo" on "Title/foo/bar").
For more complex splitting, use <code><nowiki>{{</nowiki>[[Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> from [[Help:Extension:ParserFunctions|ParserFunctions extension]].
| 1.7+
|-
|-
| <nowiki>{{uc:}}</nowiki>
| <code><nowiki>{{SUBPAGENAME}}</nowiki></code>
| <nowiki>{{uc:aBc DeF}}</nowiki> = <code>{{uc:aBc DeF}}</code>
| {{SUBPAGENAME}}
| '''[MW1.5+]''' UpperCase
| The [[Help:Subpages|subpage]] title ("foo" on "Title/foo").
| 1.6+
|-
|-
| <nowiki>{{ucfirst:}}</nowiki>
| <code><nowiki>{{SUBJECTPAGENAME}}</nowiki></code>
| <nowiki>{{ucfirst:aB cD}}</nowiki> = <code>{{ucfirst:aB cD}}</code>
| {{SUBJECTPAGENAME}}
| '''[MW1.5+]''' UpperCase first char.
| The namespace and title of the associated subject page.
| 1.7+
|-
|-
| <nowiki>{{formatnum:}}</nowiki>
| <code><nowiki>{{TALKPAGENAME}}</nowiki></code>
| <nowiki>{{formatnum:-299792458.56789}}</nowiki> = <code>{{formatnum:-299792458.56789}}</code>
| {{TALKPAGENAME}}
<br> <nowiki>{{formatnum:-299,792,458.56789|R}}</nowiki> = <code>{{formatnum:-299,792,458.56789|R}}</code>
| The namespace and title of the associated talk page.
| '''[MW1.7+]''' Changes the [[w:Decimal_separator|decimal separator]] and adds digit group  separators (before the decimal separator only) according to the wiki's default locale. Also changes the digits into the local script. Leading minus and plus are recognized.
| 1.7+
|}


'''[MW1.13+]''' Can be reversed with an ''R'' parameter.
The <code><nowiki>{{BASEPAGENAME}}</nowiki></code> and <code><nowiki>{{SUBPAGENAME}}</nowiki></code> magic words only work in namespaces that have subpages enabled.  See {{mediawiki|Manual:$wgNamespacesWithSubpages}} for information on enabling subpages.
|-
|<nowiki>{{padleft:}}</nowiki><br /><br /><br /><br /><br /><nowiki>{{padright:}}</nowiki><br />
|
<nowiki>{{padleft:7|3|0}}</nowiki> = <code>{{padleft:7|3|0}}</code><br/><br/>
<nowiki>{{padleft:0|3|0}}</nowiki> = <code>{{padleft:0|3|0}}</code><br/><br/>
<nowiki>{{padleft:bcd|6|a}}</nowiki> = <code>{{padleft:bcd|6|a}}</code><br/>
<nowiki>{{padleft:cafe|8|-}}</nowiki> = <code>{{padleft:cafe|8|-}}</code><br />


<nowiki>{{padleft:bcd|6|{{!}}}}</nowiki> = <code>{{padleft:bcd|6|{{!}}}}</code><br/>
The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters [[wikipedia:percent-encoding|percent-encoded]]):
<br/>
* <code><nowiki>{{FULLPAGENAMEE}}</nowiki></code>
<nowiki>{{padright:bcd|6|a}}</nowiki> = <code>{{padright:bcd|6|a}}</code><br />
* <code><nowiki>{{PAGENAMEE}}</nowiki></code>
<nowiki>{{padright:0|6|a}}</nowiki> = <code>{{padright:0|6|a}}</code><br />
* <code><nowiki>{{BASEPAGENAMEE}}</nowiki></code>
* <code><nowiki>{{SUBPAGENAMEE}}</nowiki></code>
* <code><nowiki>{{SUBJECTPAGENAMEE}}</nowiki></code>
* <code><nowiki>{{TALKPAGENAMEE}}</nowiki></code>


|valign="top"|<br />First case is, for example, applicable to years in a category... giving an ordered year to sort by pipetricks order, or any such ordering where left extended zeros allow a proper sorting.<br /><br /> '''[MW1.8+]''' Pads a string with a character to the specified width. Note that there's a little bug that interprets non-[[w:US-ASCII|US-ASCII]] characters as two, instead of one character (see the difference in''' ''café'' and ''cafe'' '''in the examples.)
As of {{mediawiki|rev:46662|1.15+}}, these can all take a parameter, allowing specification of the page to be operated on, instead of just the current page:
* <code><nowiki>{{PAGENAME:Template:Main Page}}</nowiki></code> &rarr; '''{{PAGENAME:Template:Main Page}}'''


It does not seem possible to use padleft and padright for padding with characters with a multi-character code, such as <code>&amp;nbsp;</code>, which would be useful with padleft for [[Help:Sorting|sorting tables]] with Javascript.
{{Warning|Page titles containing certain characters, such as single quotes (') or asterisks <code>*</code>, may produce unexpected results when handled with these magic words, e.g. <code><nowiki>{{PAGESINCATEGORY:{{PAGENAME}}}}</nowiki></code>. See bugs {{mediawiki|bugzilla:14779|14779}}, {{mediawiki|bugzilla:16474|16474}}.}}


Also, giving a non-ASCII character as a character to replicate results in a "?" character. [[bugzilla:12324]]
Note that <code><nowiki>{{PAGENAME}}</nowiki></code>, <code><nowiki>{{PAGENAMEE}}</nowiki></code> and <code><nowiki>{{urlencode:}}</nowiki></code> have distinct implementations. See [[Manual:PAGENAMEE encoding]] for details.


<!--
===Namespaces===
Padding "0" does not work, it returns the same. This seems to be a bug.<ref>Function pad in includes/CoreParserFunctions.php puts, oddly, the $string itself as a condition for the padding. To be reported as bug.</ref>
{| class="wikitable"
-->
|-
! {{Hl2}}| Variable
! {{Hl2}}| Output
! {{Hl2}}| Description
! {{Hl2}}| Versions
|-
| <code><nowiki>{{NAMESPACE}}</nowiki></code>
| {{NAMESPACE}}
| Name of the page's namespace
|
|-
| <code><nowiki>{{SUBJECTSPACE}}</nowiki></code><br /><code><nowiki>{{ARTICLESPACE}}</nowiki></code>
| {{SUBJECTSPACE}}<br />{{ARTICLESPACE}}
| Name of the associated content namespace
| 1.7+
|-
|-
| <nowiki>{{#tag:}}</nowiki>  
| <code><nowiki>{{TALKSPACE}}</nowiki></code>
| <nowiki>{{#tag:myextension | content | attr=val | attr2=val2 }}</nowiki> = <nowiki><myextension attr=val attr2=val2>content</myextension></nowiki>
| {{TALKSPACE}}
| '''[MW1.12+, r29482]''' Passes attributes and inner content to an XML-style parser tag, parsing template variables along the way. See [[MediaZilla:2257|Bug 2257]] and [[MW:Extension:TagParser|Extension:TagParser]].
| Name of the associated talk namespace
|}{{-}}
| 1.7+
|}


With regard to #language and {{tim|n local}}, see also:
The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded):
*[[List of Wikipedias/local names]] - shows both names for all languages, without automatic comparison
* <code><nowiki>{{NAMESPACEE}}</nowiki></code>
*[[List of Wikipedias/local names/diff]] - values of [[Help:Magic words#Formatting|#language]] for which <nowiki>{{n local}}</nowiki> contains a different name.
* <code><nowiki>{{SUBJECTSPACEE}}</nowiki></code>
*[[List of Wikipedias/local names/diff 1]] - for languages where the two names are different, shows both
* <code><nowiki>{{TALKSPACEE}}</nowiki></code>


Note: An alternative of LC and UC, for display only (not for further processing) is with CSS:
As of {{mediawiki|rev:46630|1.15+}}, these can take a page name parameter and will return the namespace of the page name parameter, instead of the current page's:
* <code><nowiki>{{NAMESPACE:Template:Main Page}}</nowiki></code> &rarr; '''{{NAMESPACE:Template:Main Page}}'''
* <code><nowiki>{{SUBJECTSPACE:Template:Main Page}}</nowiki></code> &rarr; '''{{SUBJECTSPACE:Template:Main Page}}'''
* <code><nowiki>{{TALKSPACE:Template:Main Page}}</nowiki></code> &rarr; '''{{TALKSPACE:Template:Main Page}}'''


*{{xpdplain|<|span style{{=}}"text-transform: lowercase">aBc deF<|/span>}}
==Parser functions==
*{{xpdplain|<|span style{{=}}"text-transform: uppercase">aBc deF<|/span>}}


Capitalizing the first letter of each word:
Parser functions are very similar to variables, but take one or more parameters (technically, any magic word that takes a parameter is a parser function), and the name is sometimes prefixed with a hash to distinguish them from templates.
*{{xpdplain|<|span style{{=}}"text-transform: capitalize">aBc deF<|/span>}}


== Template modifiers ==
This page only describes parser functions that are integral to the MediaWiki software. Other parser functions may be added by MediaWiki extensions such as the {{mediawiki|Extension:ParserFunctions|ParserFunctions extension}}. For those see [[Help:Extension:ParserFunctions]].
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"
 
! Usage
===URL data===
! Explanation
{| class="wikitable"
|-
|-
| <nowiki>{{:xyz}}</nowiki>
! {{Hl2}}| Parser function
| A bare colon is not a template modifier, it's the prefix for the main namespace. Test e.g. article {&#123;:UTC&#125;} vs. template {&#123;UTC&#125;}.<br>Using this syntax you include the text of the main namespace article xyz in another article.
! {{Hl2}}| Input → Output
! {{Hl2}}| Description
! {{Hl2}}| Versions
|-
|-
| <nowiki>{{int:xyz}}</nowiki>
| <code><nowiki>{{localurl:</nowiki>''page name''<nowiki>}}</nowiki></code><br /><code><nowiki>{{localurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code>
| Same as <nowiki>{{MediaWiki:xyz}}</nowiki>, except standard message translation is applied depending on subpages and content/user/uselang language. Another difference is: this doesn't appear under "{{int:templatesused}}". Rendered as {{int:xyz}} if [[MediaWiki:xyz]] doesn't exist. See also [[Help:System message]].
| <code><nowiki>{{localurl:MediaWiki}}</nowiki></code> → {{localurl:MediaWiki}}<br /><nowiki>{{localurl:MediaWiki|printable=yes}}</nowiki>  → {{localurl:MediaWiki|printable=yes}}
| The relative path to the title.  
|
|-
|-
| <nowiki>{{msg:xyz}}</nowiki>
| <code><nowiki>{{fullurl:</nowiki>''page name''<nowiki>}}</nowiki></code><br /><code><nowiki>{{fullurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code><br /><code><nowiki>{{fullurl:</nowiki>''interwiki:remote page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code>
| Even if there is a magic word named "xyz", use template:xyz unless the template doesn't exist (equivalent to <nowiki>{{template:xyz}}</nowiki>). Normally, magic words have priority when there is a conflict.
| <code><nowiki>{{fullurl:Category:Top level}}</nowiki></code> → {{fullurl:Category:Top level}}<br />
<code><nowiki>{{fullurl:Category:Top level|action=edit}}</nowiki></code> → {{fullurl:Category:Top level|action=edit}}
| The absolute path to the title. This will also resolve [[Manual:Interwiki|Interwiki]] prefixes.
| 1.5+
|-
|-
| <nowiki>{{msgnw:xyz}}</nowiki>
| <code><nowiki>{{filepath:</nowiki>''file name''<nowiki>}}</nowiki></code><br /><code><nowiki>{{filepath:</nowiki>''file name''<nowiki>|nowiki}}</nowiki></code>
| The unexpanded wikitext is rendered (more or less, for details see [[Help:Template#msgnw|msgnw]]).
| <code><nowiki>{{filepath:Wiki.png}}</nowiki></code> → {{filepath:Wiki.png}}<br />
<code><nowiki>{{filepath:Wiki.png|nowiki}}</nowiki></code> → {{filepath:Wiki.png|nowiki}}<br />
<code><nowiki>{{filepath:Example.svg|300}}</nowiki></code> → http://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Example.svg/300px-Example.svg.png<br />
| The absolute URL to the full size or thumbnail ({{mediawiki|rev:80813|1.18+}}) of a media file.
| {{mediawiki|rev:25854|1.12+}}<br />{{mediawiki|rev:80813|1.18+}}
|-
|-
| <nowiki>{{raw:xyz}}</nowiki>
| <code><nowiki>{{urlencode:</nowiki>''string''<nowiki>}}</nowiki></code> (or <code><nowiki>{{urlencode:</nowiki>''string''<nowiki>|QUERY}}</nowiki></code>)<br /><code><nowiki>{{urlencode:</nowiki>''string''<nowiki>|WIKI}}</nowiki></code><br /><code><nowiki>{{urlencode:</nowiki>''string''<nowiki>|PATH}}</nowiki></code>
| '''[MW1.6+]''' Equivalent to <code><nowiki>{{msg:xyz}}</nowiki></code> above<ref>[http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=12925 Wikimedia SVN revision 12925]</ref>.
| <code><nowiki>{{urlencode:x y z á é}}</nowiki></code> (or <code><nowiki>{{urlencode:x y z á é|QUERY}})</nowiki></code> → {{urlencode:x y z á é}}<br /><code><nowiki>{{urlencode:x y z á é|WIKI}}</nowiki></code> → x_y_z_%C3%A1_%C3%A9<br /><code><nowiki>{{urlencode:x y z á é|PATH}}</nowiki></code> → x%20y%20z%20%C3%A1%20%C3%A9
Note that the default changed from <code>|WIKI</code> to <code>|QUERY</code> in 1.17; this may break templates that rely on this function.
| The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete [[Extension:StringFunctions]].
| {{mediawiki|rev:14273|1.7+}} (or {{mediawiki|rev:64726|1.17+}})<br />{{mediawiki|rev:64726|1.17+}}<br />{{mediawiki|rev:64726|1.17+}}
|-
|-
| <nowiki>{{subst:xyz}}</nowiki>
| <code><nowiki>{{anchorencode:</nowiki>''string''<nowiki>}}</nowiki></code>
| <code><nowiki>{{anchorencode:x y z á é}}</nowiki></code> → {{anchorencode:x y z á é}}
| The input encoded for use in URL section anchors (after the '#' symbol in a URL).
| {{mediawiki|rev:16279|1.8+}}
|}


 
===Namespaces===
 
<code><nowiki>{{ns:}}</nowiki></code> returns the localized name for the [[Help:Namespace|namespace]] with that index. <code><nowiki>{{nse:}}</nowiki></code> is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.
| In the wikitext, the tag is substituted by the ''content'' (single-level evaluation only), see [[Help:Substitution]].
{| class="wikitable"
|}{{-}}
|-
 
! {{hl3}} colspan="2" width="50%" | Content namespaces
== Image modifiers ==
! rowspan="12" |
:''For details see [[w:en:Wikipedia:Extended image syntax]].''
! {{hl3}} colspan="2" width=%50%" | Talk namespaces
These are [[Help:Image page|image]] modifiers used in <code><nowiki>[[Image:title.ext|modifier|...|modifier]]</nowiki></code> links. Some are mutually exclusive, and then the last specified wins.  The last unrecognized modifier is used as '''caption''' for [[w:framed image|''framed'' images]] or together with ''[[w:thumbnail|thumbnail]]''s. It's also used as description <tt>alt=</tt>''text''.
|-
 
! {{Hl2}}| Usage
=== Size ===
! {{Hl2}}| Output
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"  
! {{Hl2}}| Usage
! Word
! {{Hl2}}| Output
! Usage  
|-
! Explanation
| <code><nowiki>{{ns:-2}}</nowiki></code> or <code><nowiki>{{ns:Media}}</nowiki></code>
| {{ns:-2}} || ||
|-
| <code><nowiki>{{ns:-1}}</nowiki></code> or <code><nowiki>{{ns:Special}}</nowiki></code>
| {{ns:-1}} || ||
|-
|-
| framed<br/>frame<br/>enframed
| <code><nowiki>{{ns:0}}</nowiki></code> or <code><nowiki>{{ns:}}</nowiki></code>
| <nowiki>[[Image:Mediawiki.png|framed]]</nowiki>
| {{ns:}}
| Places an image in a ''frame'' with a description. Uses original size and stubbornly ignores width parameter if given.<br>In general, far better to use thumb, as is only suitable for small images.
| <code><nowiki>{{ns:1}}</nowiki></code> or <code><nowiki>{{ns:Talk}}</nowiki></code>
| {{ns:1}}
|-
|-
| border
| <code><nowiki>{{ns:2}}</nowiki></code> or <code><nowiki>{{ns:User}}</nowiki></code>
| <nowiki>[[Image:Mediawiki.png|border]]</nowiki>
| {{ns:2}}
| Shows a 1px border around the image.
| <code><nowiki>{{ns:3}}</nowiki></code> or <code><nowiki>{{ns:User talk}}</nowiki></code>
| {{ns:3}}
|-
|-
| thumbnail<br/>thumb
| <code><nowiki>{{ns:4}}</nowiki></code> or <code><nowiki>{{ns:Project}}</nowiki></code>
| <nowiki>[[Image:Mediawiki.png|thumbnail]]</nowiki>
| {{ns:4}}
| Modifies image size, sets it dependent on user's favorite thumbnail size in one's preferences, or on the given width parameter (see below).
| <code><nowiki>{{ns:5}}</nowiki></code> or <code><nowiki>{{ns:Project talk}}</nowiki></code>
| {{ns:5}}
|-
|-
| thumb=''xyz''
| <code><nowiki>{{ns:6}}</nowiki></code> or <code><nowiki>{{ns:File}}</nowiki></code> or <code><nowiki>{{ns:Image}}</nowiki></code>
| <nowiki>[[Image:Mediawiki.png|thumb=Wiki.png]]</nowiki>
| {{ns:6}}
| Manualthumb: instead of displaying an automatically-sized thumbnail for <var>Mediawiki.png</var>, display the image <var>Wiki.png</var>.
| <code><nowiki>{{ns:7}}</nowiki></code> or <code><nowiki>{{ns:File talk}}</nowiki></code> or <code><nowiki>{{ns:Image talk}}</nowiki></code>
|-valign="top"
| {{ns:7}}
| ''width'' px<br>100x200px
| <nowiki>[[Image:Mediawiki.png|40px]]</nowiki><br><nowiki>[[Image:Mediawiki.png|100x200px]]</nowiki>
| Scales image to given ''width''&#160; in pixels<br>Scales image to no more than 100 pixels wide and no more than 200 high, but image scaled to retain its true aspect ratio within the boundary specified.
|}{{-}}
 
=== Position ===
:''For details see [[Help:Images and other uploaded files]]''
The positions are mutually exclusive; the last specified wins. [[:Template:-]] can stop floating. For inline images only modifier ''px'' (see above) is supported.
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" width="100%"
! Word
! Usage
! Explanation
|-
|-
| right
| <code><nowiki>{{ns:8}}</nowiki></code> or <code><nowiki>{{ns:MediaWiki}}</nowiki></code>
| <nowiki>[[Image:Mediawiki.png|right]]</nowiki>
| {{ns:8}}
| Modifies position, floats the image to the right.
| <code><nowiki>{{ns:9}}</nowiki></code> or <code><nowiki>{{ns:MediaWiki talk}}</nowiki></code>
| {{ns:9}}
|-
|-
| <nowiki>left</nowiki>
| <code><nowiki>{{ns:10}}</nowiki></code> or <code><nowiki>{{ns:Template}}</nowiki></code>
| <nowiki>[[Image:Mediawiki.png|left]]</nowiki>
| {{ns:10}}
| Modifies position, floats the image to the left.
| <code><nowiki>{{ns:11}}</nowiki></code> or <code><nowiki>{{ns:Template talk}}</nowiki></code>
| {{ns:11}}
|-
|-
| <nowiki>none</nowiki>
| <code><nowiki>{{ns:12}}</nowiki></code> or <code><nowiki>{{ns:Help}}</nowiki></code>
| <nowiki>[[Image:Mediawiki.png|none]]</nowiki>
| {{ns:12}}
| Explicitly states that the image should not float.
| <code><nowiki>{{ns:13}}</nowiki></code> or <code><nowiki>{{ns:Help talk}}</nowiki></code>
| {{ns:13}}
|-
|-
| center<br />centre
| <code><nowiki>{{ns:14}}</nowiki></code> or <code><nowiki>{{ns:Category}}</nowiki></code>
| <nowiki>[[Image:Mediawiki.png|center]]</nowiki>
| {{ns:14}}
| Modifies position, like ''none'' but centered.
| <code><nowiki>{{ns:15}}</nowiki></code> or <code><nowiki>{{ns:Category talk}}</nowiki></code>
|}{{-}}
| {{ns:15}}
|}


== Miscellany ==
===Formatting===
 
<!--Well gosh, with the source of the examples hidden, who can tell what you are inputting without looking here in the source?-->
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"
{| class="wikitable"
! Word
! {{Hl2}}| Usage
! Example
! {{Hl2}}| Input → Output
! Explanation
! {{Hl2}}| Description
! {{Hl2}}| Version
|-
|-
| <code><nowiki>{{lc:</nowiki>''string''<nowiki>}}</nowiki></code>
| <code><nowiki>{{lc:DATA CENTER}}</nowiki></code> → {{lc:DATA CENTER}}
| The lowercase input.
| 1.5+
|-
|-
| <nowiki>{{DISPLAYTITLE:</nowiki>''xyz''<nowiki>}}</nowiki>
| <code><nowiki>{{lcfirst:</nowiki>''string''<nowiki>}}</nowiki></code>
| ''no inline output''
| <code><nowiki>{{lcfirst:DATA center}}</nowiki></code> → {{lcfirst:DATA center}}
| '''[MW 1.7+]''' Modify the page's title [http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=13572], enabled in Wikimedia projects since June 2007 ([http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=23393]). Also see {{h:mwg|AllowDisplayTitle}}.
| The input with the <u>very first</u> character lowercase.
| 1.5+
|-
|-
| <nowiki>{{DIRMARK}}</nowiki><br /><nowiki>{{DIRECTIONMARK}}</nowiki>
| <code><nowiki>{{uc:</nowiki>''string''<nowiki>}}</nowiki></code>
| <code>{{DIRMARK}}</code><br /><code>{{DIRECTIONMARK}}</code>
| <code><nowiki>{{uc:text transform}}</nowiki></code> {{uc:text transform}}
| '''[MW1.7+]''' u+200E left to right or u+200D right to left mark
| The uppercase input.
| 1.5+
|-
|-
| <nowiki>{{CONTENTLANGUAGE}}</nowiki>
| <code><nowiki>{{ucfirst:</nowiki>''string''<nowiki>}}</nowiki></code>
| <code>{{CONTENTLANGUAGE}}</code>
| <code><nowiki>{{ucfirst:text TRANSFORM}}</nowiki></code> {{ucfirst:text TRANSFORM}}
| '''[MW1.7+]''' code of the site's default interface language ({{h:mwg|LanguageCode}})
| The input with the <u>very first</u> character uppercase.
| 1.5+
|-
|-
| <nowiki>{{DEFAULTSORT:xyz}}</nowiki>
| <code><nowiki>{{formatnum:</nowiki>''unformatted&nbsp;num''<nowiki>}}</nowiki></code><br /><code><nowiki>{{formatnum:</nowiki>''formatted&nbsp;num''<nowiki>|R}}</nowiki></code>
| ''no inline output''
| <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code><br/> → {{formatnum:987654321.654321}}<br /> <code><nowiki>{{formatnum:987,654,321.654321|R}}</nowiki></code><br/> → {{formatnum:987,654,321.654321|R}}<br /> <code><nowiki>{{formatnum:00001}}</nowiki></code><br/> → {{formatnum:00001}}
| '''[MW1.10+]''' Sets a default [[Help:Categories#Sort_key|category sort key]] for the whole current page (also applying for category tags before this tag)<ref>"[[w:Wikipedia:Wikipedia Signpost/2007-01-02/Technology report|Technology report]]", en-Wikipedia Signpost, January 2007</ref>.
| The input with decimal and decimal group separators, and localized digit script, according to the wiki's default locale. The <code><nowiki>|</nowiki>R</code> parameter can be used to unformat a number, for use in mathematical situations.<br/><small>{{warning}}Leading zeroes are not removed, you can use <nowiki>{{#expr:00001}}</nowiki> instead if you have [[Extension:ParserFunctions]] installed</small>
| 1.7+<br />{{mediawiki|rev:32012|1.13+}}
|-
|-
| <nowiki>#REDIRECT</nowiki>  
|
| <code>#REDIRECT&#160;[&#91;target&#93;]</code><br />at top of source page
<code><nowiki>{{#dateformat:</nowiki>''date''<nowiki>}}
| Creates a [[Help:Redirect|redirect]] to another page (to the target page).
{{#formatdate:</nowiki>''date''<nowiki>}}
|}{{-}}
{{#dateformat:</nowiki>''date''{{!}}''format''<nowiki>}}
{{#formatdate:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code>
|  
<code><nowiki>{{#dateformat:25 deC 2009|ymd}}</nowiki></code><br/>
→ {{#dateformat:25 deC 2009|ymd}} (your pref),  2009 DeC 25 (default)<br/>
<code><nowiki>{{#formatdate:dec 25,2009|dmy}}</nowiki></code><br/>
→ {{#formatdate:dec 25,2009|dmy}} (your pref), 25 Dec 2009 (default)<br/>
<code><nowiki>{{#dateformat:2009-12-25|mdy}}</nowiki></code><br/>
→ {{#dateformat:2009-12-25|mdy}} (your pref), December 25, 2009 (default)<br/>
<code><nowiki>{{#formatdate:2009 dec 25|ISO 8601}}</nowiki></code><br/>
→ {{#formatdate:2009 dec 25|ISO 8601}} (your pref), 2009-12-25 (default)<br/>
<code><nowiki>{{#dateformat:25 decEmber|mdy}}</nowiki></code><br/>
{{#dateformat:25 decEmber|mdy}} (your pref), DecEmber 25 (default)<br/>


Despite its name <tt>MAGICNUMBER</tt> is no magic word, the [[m:Help:ISBN links|ISBN]] magic works only on the [[{{ns:4}}:{{int:Booksources}}|{{ns:8}}:Booksources]] page used by [[Special:Booksources]], but talking about <tt><nowiki>[[{{ns:4}}:{{int:Booksources}}|{{ns:8}}:Booksources]]</nowiki></tt> in a way working on any MediaWiki installation is esoteric enough to be noted here.


===Language-dependent word conversions===
Note: In the example above, "your pref" refers to your date preference on the current MediaWiki wiki only.
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"
| Formats an unlinked date based on user "Date format" preference, and adds metadata tagging it as a formatted date. For logged-out users and those who have not set a date format in their preferences, dates can be given a default: <code>mdy</code>, <code>dmy</code>, <code>ymd</code>, <code>ISO&nbsp;8601</code> (all case sensitive). If only the month and day are given, only <code>mdy</code> and <code>dmy</code> are valid. If a format is not specified or is invalid, the input format is used as a default. If the supplied date is not recognized as a valid date (specifically, if it contains any metadata such as from a nested use of these or similar templates), it is rendered unchanged, and no (additional) metadata is generated.<br/><small>{{warning}}Although the ISO 8601 standard requires that dates be in the Gregorian calendar, the ISO parameter in this function will still format dates that fall outside the usual Gregorian range (e.g. dates prior to 1583). Also, the magic word cannot properly convert between negative years (used with ISO 8601) and years BC or years BCE (used in general writing).</small>
! Word
| {{mediawiki|rev:48249|1.15+}}
! Example
! Explanation
|-
|-
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki>
| <code><nowiki>{{padleft:xyz|</nowiki>''stringlength''<nowiki>}}</nowiki></code><br /><code><nowiki>{{padleft:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''char''<nowiki>}}</nowiki></code><br /><code><nowiki>{{padleft:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''string''<nowiki>}}</nowiki></code>
| <code>{{CURRENTMONTHNAMEGEN}}</code>
| <code><nowiki>{{padleft:xyz|5}}</nowiki></code> → {{padleft:xyz|5}}<br /> <code><nowiki>{{padleft:xyz|5|_}}</nowiki></code> → {{padleft:xyz|5|_}} <code><nowiki>{{padleft:xyz|5|abc}}</nowiki></code> → {{padleft:xyz|5|abc}} <code><nowiki>{{padleft:xyz|2}}</nowiki></code> → {{padleft:xyz|2}}<br /> <code><nowiki>{{padleft:|1|xyz}}</nowiki></code> → {{padleft:|1|xyz}} (first character of the string)<br />
| [[w:genitive case|Genitive form]] of month name used for Czech, Polish, Ukrainian[http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/]
| Inserts a string of padding characters (character chosen in third parameter; default '0') of a specified length (second parameter) next to a chosen base character or variable (first parameter). The final digits or characters in the base replace the final characters in the padding; i.e. <code><nowiki>{{padleft:44|3|0}}</nowiki></code> produces {{padleft:44|3}}. The padding string may be truncated if its length does not evenly divide the required number of characters.<br />'''{{mediawiki|bugzilla:16852|bug}} (fixed in {{mediawiki|rev:45734|r45734}}):''' multibyte characters are interpreted as two characters, which can skew width. These also cannot be used as padding characters.
| 1.8+
|-
|-
| <nowiki>{{LOCALMONTHNAMEGEN}}</nowiki>
| <code><nowiki>{{padright:xyz|</nowiki>''stringlength''<nowiki>}}</nowiki></code><br /><code><nowiki>{{padright:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''char''<nowiki>}}</nowiki></code><br /><code><nowiki>{{padright:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''string''<nowiki>}}</nowiki></code>
| <code>{{LOCALMONTHNAMEGEN}}</code>
| <code><nowiki>{{padright:xyz|5}}</nowiki></code> → {{padright:xyz|5}}<br />
| [[w:genitive case|Genitive form]] of month name used for Czech, Polish, Ukrainian (local time)
<code><nowiki>{{padright:xyz|5|_}}</nowiki></code> → {{padright:xyz|5|_}}
<code><nowiki>{{padright:xyz|5|abc}}</nowiki></code> → {{padright:xyz|5|abc}}
<code><nowiki>{{padright:xyz|2}}</nowiki></code> → {{padright:xyz|2}}<br />
<code><nowiki>{{padright:|1|xyz}}</nowiki></code> → {{padright:|1|xyz}}<br />
| Identical to padleft, but adds padding characters to the right side.
|
|-
|-
| {&#123;grammar:''case &#124; word'' &#125;}  
| <code><nowiki>{{plural:2|</nowiki>''is''<nowiki>|</nowiki>''are''<nowiki>}}</nowiki></code>
| <nowiki>{{grammar:7sg|Wikipedie}}</nowiki><br />on [[:cs:]] is <code>Wikipedií</code>.
| <code><nowiki>{{plural:0|is|are}}</nowiki></code> → {{plural:0|is|are}}<br /> <code><nowiki>{{plural:1*1|is|are}}</nowiki></code> → {{plural:1*1|is|are}}<br /> <code><nowiki>{{plural:21 mod 10|is|are}}</nowiki></code> → {{plural:21 mod 10|is|are}}<br /> <code><nowiki>{{plural:{{#expr:21 mod 10}}|is|are}}</nowiki></code> → {{plural:{{#expr:21 mod 10}}|is|are}}<br />  <code><nowiki>{{plural:1|is|are}}</nowiki></code> → {{plural:1|is|are}}<br /> <code><nowiki>{{plural:2|is|are}}</nowiki></code> → {{plural:2|is|are}}<br /> (for [[:w:Polish language|Polish]]):<br /><code><nowiki>{{plural:2|milion|miliony|milionów}}</nowiki></code> → miliony
| Derived word forms in inflected languages like [[:cs:|Czech]] [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/classes/LanguageCs.php]
| Outputs the singular form (second parameter) if the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Plural transformations are used for languages like Russian based on "count mod 10". You should not expect this to handle fractions (like 44.5) — see [[bugzilla:28128|bug 28128]].
|
|-
|-
| {&#123;plural:''count &#124;form1 &#124;form2'' &#125;}<br />{&#123;plural:''count&#160;&#124;1st&#160;&#124;&#160;2nd&#160;&#124;&#160;3rd&#160;''&#125;}
| <code><nowiki>{{grammar:N|</nowiki>''noun''<nowiki>}}</nowiki></code>
| <nowiki>{{plural: 2 | is | are }}</nowiki><br />outputs <code>{{plural: 2 | is |are }}</code><br /><nowiki>{{plural: 1 | this | these }}</nowiki><br />outputs <code>{{plural: 1 |this | these }}</code><br /><nowiki>{{plural: 0 | his | their }}</nowiki><br />outputs <code>{{plural: 0 |his | their }}</code>
|  
| ''count'' '''1''' yields ''form1'' (singular), [[w:Plural|plural]] transformations are used for languages like [[:ru:|Russian]] [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/classes/LanguageRu.php] based on "count mod 10".
| Outputs the correct inflected form of the given word described by the inflection code after the colon (language-dependent).  Grammar transformations are used for inflected languages like Polish.  See also {{mediawiki|Manual:$wgGrammarForms}}.
|}{{-}}
| 1.7+
|}


"Grammar" and "Plural" are language-dependent functions, defined in [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/classes/LanguageCs.php], [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/classes/LanguageRu.php], etc. (note that in PHP, the modulo operator is the percent sign).
===Miscellaneous===
{| class="wikitable plainlinks"
! {{Hl2}}| Usage
! {{Hl2}}| Output
! {{Hl2}}| Description
! {{Hl2}}| Version
|-
| <code><nowiki>{{int:</nowiki>''message name''<nowiki>}}</nowiki>
| <code><nowiki>{{int:</nowiki>edit<nowiki>}}</nowiki></code> &rarr; '''{{int:edit}}''' <br /><small>''(depends on user language, try: [{{fullurl:{{FULLPAGENAME}}|uselang=fr}}#Miscellaneous fr] &bull;[{{fullurl:{{FULLPAGENAME}}|uselang=ja}}#Miscellaneous ja])''</small>
| Internationalizes (translates) the given '''int'''erface (MediaWiki namespace) message into the user language. ''Note that this can damage/confuse cache consistency, see [[bugzilla:14404|bug 14404]].''
|
|-
| <code><nowiki>{{#language:</nowiki>''language code''<nowiki>}}</nowiki></code><br /><code><nowiki>{{#language:ar}}</nowiki></code><br /><code><nowiki>{{#language:th}}</nowiki></code>
| {{#language:language code}}<br />{{#language:ar}}<br />{{#language:th}}
| The native name for the given language code, in accordance with [[w:ISO 639|ISO 639]].
| {{mediawiki|rev:14490|1.7+}}
|-
| <code><nowiki>{{#special:</nowiki>''special page name''<nowiki>}}</nowiki><br /><nowiki>{{#special:userlogin}}</nowiki></code>
| {{#special:special page name}}<br />{{#special:userlogin}}
| The localized name for the given canonical Special: page.
| {{mediawiki|rev:17321|1.9+}}
|-
| <code><nowiki>{{#tag:</nowiki>''tagname''<br><nowiki>|</nowiki>''content''<br><nowiki>|</nowiki>''parameter1=value1''<br /><nowiki>|</nowiki>''parameter2=value2''<br /><nowiki>}}</nowiki></code>
| ''(depends on parser tag)''
| Alias for XML-style parser or extension tags, but parsing wiki code. Inner content can be passed as first parameter, and attributes as subsequent ones:


"Grammar" can either be applied to predefined words only, or to arbitrary words, depending on whether the definition is just a 2D array, or involves string manipulations. See also [[:cs:Šablona:Wikivar/GRAMMAR]].
<code><</code>''tagname'' ''attribute1''="''value1''" ''attribute2''="''value2''"<code>></code> ''content'' <code></</code>''tagname'' <code>></code> &rarr; <code><nowiki>{{#tag:</nowiki></code>''tagname''<code><nowiki>|</nowiki></code>''content''<code><nowiki>|</nowiki></code>''attribute1''=''value1''<code><nowiki>|</nowiki></code>''attribute2''=''value2''<code><nowiki>}}</nowiki></code>


"Plural" is a site-language-dependent switch function, controlled by function convertPlural in Language.php (which distinguishes between 1 and "not 1"), for some languages overridden in Languagexx.php, e.g. for French (which distinguishes between <=1 and >1) and Russian, which uses a grammar case for amounts ending in 1 (1, 21, 31,...), another case for amounts ending in 2 to 4 (2, 3, 4, 22, 23, 24, ...) and still another case for the remaining quantities.
'''Warning''' : You must write <code><nowiki>{{#tag:</nowiki></code>''tagname''<code><nowiki>||</nowiki></code>''attribute1''=''value1''<code><nowiki>|</nowiki></code>''attribute2''=''value2''<code><nowiki>}}</nowiki></code> to pass an empty content.
 
No space is permitted between the {{!}} and the attribute name.
As opposed to [[ParserFunctions]], "plural" accepts points and commas in numbers and interprets them in a site-language-specific way (depending on $separatorTransformTable in Messagesxx.php); on this site:
| {{mediawiki|rev:29482|1.12+}}
*<nowiki>{{plural:1.000|a|b|c}}</nowiki> gives {{plural:1.000|a|b|c}}
|-
*<nowiki>{{plural:1,000|a|b|c}}</nowiki> gives {{plural:1,000|a|b|c}}
| <code><nowiki>{{gender:</nowiki>''username''<br /><nowiki>|</nowiki>''return text if user is male''<br /><nowiki>|</nowiki>''return text if user is female''<br /><nowiki>|</nowiki>''return text if user hasn't defined their gender''<nowiki>}}</nowiki></code>
 
| ''(depends on the named user's gender)''
(on e.g. the German and the Dutch sites reversed w.r.t. the result on English sites).
| A switch for the gender set in [[Special:Preferences]]<br/>
 
Note:  If 3rd parameter is omitted and user hasn't defined his/her gender, then <code>''text if user is male''</code> is returned.
"Plural" is used in various system messages, e.g. {{msg|nmembers}}, where it uses interface language instead of site language.
| {{mediawiki|rev:46247|1.15+}}
|}


===See also===
{{languages}}
*[[mw:Help:Extension:ParserFunctions|ParserFunctions]] '''#expr:''', '''#if:''', '''#ifeq:''', etc.
*[[mw:Manual:Magic words]]
*[http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/Language.php Source for Language.php]
*[http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/includes/MagicWord.php Source for MagicWord.php]
*[[m:Extending_wiki_markup#Parser_functions|Adding parser functions]]
*[[mw:Extension:Variables]] '': adding new magic words like <nowiki>{{CURRENTUSER}}</nowiki>''


==Notes and references==
[[Category:Help|{{PAGENAME}}]]
<div style="font-size:0.9em;"><references/></div>
[[Category:Time|{{PAGENAME}}]]
{{H:f|enname=Magic words}}
[[Category:Magic words|{{PAGENAME}}]]

Latest revision as of 01:01, 13 June 2011

Magic words are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page is about usage of standard magic words; for a technical reference, see {{ #ifeq:

 dankwiki

| MediaWiki | Manual:Magic words | Manual:Magic words }}.

There are three general types of magic words:

  • Behavior switches: these are uppercase words surrounded by double underscores, e.g. __FOO__
  • Variables: these are uppercase words surrounded by double braces, e.g. {{FOO}}. As such, they look a lot like templates.
  • Parser functions: these take parameters and are either of the form {{foo:...}} or {{#foo:...}}. See also {{ #ifeq:
 dankwiki

| MediaWiki | Help:Extension:ParserFunctions | Help:Extension:ParserFunctions }}.

Page-dependent magic words will affect or return data about the current page (by default), even if the word is added through a transcluded template or included system message.

Behavior switches

A behavior switch controls the layout or behaviour of the page and can often be used to specify desired omissions and inclusions in the content.

Word Description Versions
Table of contents
__NOTOC__ Hides the table of contents (TOC).
__FORCETOC__ Forces the table of content to appear at its normal position (above the first header).
__TOC__ Places a table of contents at the word's current position (overriding __NOTOC__). If this is used multiple times, the table of contents will appear at the first word's position.
Editing
__NOEDITSECTION__ Hides the section edit links beside headings.
__NEWSECTIONLINK__ Adds a link ("+" by default) beside the "edit" tab for adding a new section on a non-talk page (see {{ #ifeq:
 dankwiki
MediaWiki Adding a section to the end Adding a section to the end

}}).

1.7+
__NONEWSECTIONLINK__ Removes the link beside the "edit" tab on pages in talk namespaces. {{ #ifeq:
 dankwiki
MediaWiki 1.15+ 1.15+

}}

Categories
__NOGALLERY__ Used on a category page, replaces thumbnails in the category view with normal links. 1.7+
__HIDDENCAT__ Used on a category page, hides the category from the lists of categories in its members and parent categories (there is an option in the user preferences to show them). 1.13+
Language conversion
__NOCONTENTCONVERT__
__NOCC__
On wikis with language variants, don't perform any content language conversion (character and phase) in article display; for example, only show Chinese (zh) instead of variants like zh_cn, zh_tw, zh_sg, or zh_hk.
__NOTITLECONVERT__
__NOTC__
On wikis with language variants, don't perform language conversion on the title (all other content is converted).
Other
__START__ No effect.
__END__ Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in {{ #ifeq:
 dankwiki
MediaWiki 19213 19213

}}.

1.1–1.8
__INDEX__ Tell search engines to index the page (overrides {{ #ifeq:
 dankwiki
MediaWiki $wgArticleRobotPolicies $wgArticleRobotPolicies

}}, but not robots.txt).

1.14+
__NOINDEX__ Tell search engines not to index the page (ie, do not list in search engines' results). {{ #ifeq:
 dankwiki
MediaWiki 1.14+ 1.14+

}}

__STATICREDIRECT__ On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "Update any redirects that point to the original title". {{ #ifeq:
 dankwiki
MediaWiki 1.13+ 1.13+

}}

Variables

Variables return information about the current page, wiki, or date. Their syntax is similar to templates. Variables marked as "[expensive]" are tracked by the software, and the number that can be included on a page is limited.

If a template name conflicts with a variable, the variable will be used (so to transclude the template Template:PAGENAME you would need to write {{Template:PAGENAME}}). In some cases, adding parameters will force the parser to invoke a template; for example, {{CURRENTDAYNAME|x}} transcludes Template:CURRENTDAYNAME not the variable.

Date and time

The following variables return the current date and time in UTC.

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

Variable Output Description Versions
Year
{{CURRENTYEAR}} 2022 Year
Month
{{CURRENTMONTH}} 09 Month (zero-padded number)
{{CURRENTMONTHNAME}} September Month (name)
{{CURRENTMONTHNAMEGEN}} September Month (genitive form)
{{CURRENTMONTHABBREV}} Sep Month (abbreviation) 1.5+
Day
{{CURRENTDAY}} 30 Day of the month (unpadded number)
{{CURRENTDAY2}} 30 Day of the month (zero-padded number) 1.6+
{{CURRENTDOW}} 5 Day of the week (unpadded number)
{{CURRENTDAYNAME}} Friday Day of the week (name)
Time
{{CURRENTTIME}} 22:03 Time (24-hour HH:mm format)
{{CURRENTHOUR}} 22 Hour (24-hour zero-padded number)
Other
{{CURRENTWEEK}} 39 Week (number)
{{CURRENTTIMESTAMP}} 20220930220358 YYYYMMDDHHmmss timestamp 1.7+

The following variables do the same as the above, but using the site's server config or $wgLocaltimezone.

  • {{LOCALYEAR}}
  • {{LOCALMONTH}}
  • {{LOCALMONTHNAME}}
  • {{LOCALMONTHNAMEGEN}}
  • {{LOCALMONTHABBREV}}
  • {{LOCALDAY}}
  • {{LOCALDAY2}}
  • {{LOCALDOW}}
  • {{LOCALDAYNAME}}
  • {{LOCALTIME}}
  • {{LOCALHOUR}}
  • {{LOCALWEEK}}
  • {{LOCALTIMESTAMP}}
For more thorough time formatting, you may want to install Extension:ParserFunctions to use the #time parser function

Technical metadata

Note: Revision variables return data about the latest edit to the current page, even if viewing an older version of the page.

Variable Output Description Versions
Site
{{SITENAME}} dankwiki The wiki's site name ({{ #ifeq:
 dankwiki
MediaWiki $wgSitename $wgSitename

}}).

{{SERVER}} https://nick-black.com domain URL ({{ #ifeq:
 dankwiki
MediaWiki $wgServer $wgServer

}})

{{SERVERNAME}} nick-black.com domain name (No longer dependent on {{ #ifeq:
 dankwiki
MediaWiki $wgServerName $wgServerName

}} as of version 1.17)

{{DIRMARK}}
{{DIRECTIONMARK}}

Outputs a unicode-directional mark that matches the wiki's default language's direction (&lrm; on left-to-right wikis, &rlm; on right-to-left wikis), useful in text with multi-directional text. 1.7+
{{SCRIPTPATH}} /dankwiki relative script path ({{ #ifeq:
 dankwiki
MediaWiki $wgScriptPath $wgScriptPath

}})

{{STYLEPATH}} /dankwiki/skins relative style path ({{ #ifeq:
 dankwiki
MediaWiki $wgStylePath $wgStylePath

}})

1.16+
{{CURRENTVERSION}} 1.38.4 (1187efc) The wiki's MediaWiki version. 1.7+
{{CONTENTLANGUAGE}}
{{CONTENTLANG}}
en
en
The wiki's default interface language ({{ #ifeq:
 dankwiki
MediaWiki $wgLanguageCode $wgLanguageCode

}})

1.7+
Latest revision to current page
{{REVISIONID}} 3815 Unique revision ID 1.5+
{{REVISIONDAY}} 13 Day edit was made (unpadded number) 1.8+
{{REVISIONDAY2}} 13 Day edit was made (zero-padded number) 1.8+
{{REVISIONMONTH}} 06 Month edit was made (zero-padded number as of {{ #ifeq:
 dankwiki
MediaWiki 1.17+ 1.17+

}}, unpadded number in prior versions)

1.8+
{{REVISIONYEAR}} 2011 Year edit was made 1.8+
{{REVISIONTIMESTAMP}} 20110613010127 Timestamp as of time of edit 1.8+
{{REVISIONUSER}} Dank The username of the user who made the most recent edit to the page, or the current user when previewing an edit {{ #ifeq:
 dankwiki
MediaWiki 1.15+ 1.15+

}}

{{PAGESIZE:page name}}
{{PAGESIZE:page name|R}}
37,073
37073
[expensive] Returns the byte size of the specified page. Use "|R" to get raw numbers. {{ #ifeq:
 dankwiki
MediaWiki 1.13+ 1.13+

}}

{{PROTECTIONLEVEL:action}} protection level Outputs the protection level (e.g. 'autoconfirm', 'sysop') for a given action (e.g. 'edit', 'move') on the current page or an empty string if not protected. {{ #ifeq:
 dankwiki
MediaWiki 1.15+ 1.15+

}}

Affects page content
{{DISPLAYTITLE:title}} Format the current page's title header. The value must be equivalent to the default title: only capitalization changes and replacing spaces with underscores. It can be disabled or enabled by {{ #ifeq:
 dankwiki
MediaWiki $wgAllowDisplayTitle $wgAllowDisplayTitle

}}; disabled by default before 1.10+, enabled by default thereafter.

1.7+
{{DEFAULTSORT:sortkey}}
{{DEFAULTSORTKEY:sortkey}}
{{DEFAULTCATEGORYSORT:sortkey}}
Used for categorizing pages, sets a default category sort key. For example if you put {{DEFAULTSORT:Smith, John}} at the end of John Smith, the page would be sorted under "S" by default in categories. 1.10+

Statistics

Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, {{NUMBEROFPAGES}} → 1,440 and {{NUMBEROFPAGES:R}} → 1440). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example {{PAGESINCATEGORY:Help}} and {{PAGESINCATEGORY:Help|R}}). Also applicable to {{PAGESIZE:page name}} above.

Variable Output Description Versions
Entire wiki
{{NUMBEROFPAGES}} 1,440 Number of wiki pages. 1.7+
{{NUMBEROFARTICLES}} 537 Number of pages in {{ #ifeq:
 dankwiki
MediaWiki content namespaces content namespaces

}}.

{{NUMBEROFFILES}} 331 Number of uploaded files. 1.5+
{{NUMBEROFEDITS}} 8,528 Number of page edits. {{ #ifeq:
 dankwiki
MediaWiki 1.10+ 1.10+

}}

{{NUMBEROFVIEWS}} Template:NUMBEROFVIEWS Number of page views. Usually useless on a wiki using caching. {{ #ifeq:
 dankwiki
MediaWiki 1.14+ 1.14+

}}

{{NUMBEROFUSERS}} 4 Number of registered users. 1.7+
{{NUMBEROFADMINS}} 2 Number of users in the sysop {{ #ifeq:
 dankwiki
MediaWiki group group

}}.

1.7+
{{NUMBEROFACTIVEUSERS}} 0 Number of active users, based on the criteria used in Special:Statistics. {{ #ifeq:
 dankwiki
MediaWiki 1.15+ 1.15+

}}

{{PAGESINCATEGORY:categoryname}}
{{PAGESINCAT:Help}}
45
45
[expensive] Number of pages in the given category. {{ #ifeq:
 dankwiki
MediaWiki 1.13+ 1.13+

}}

{{NUMBERINGROUP:groupname}}
{{NUMINGROUP:groupname}}
2
2
({{NUMBERINGROUP:bureaucrat}} used here)
Number of users in a specific {{ #ifeq:
 dankwiki
MediaWiki group group

}}.

{{ #ifeq:
 dankwiki
MediaWiki 1.14+ 1.14+

}}

{{PAGESINNS:index}}
{{PAGESINNAMESPACE:index}}
not enabled Number of pages in the given namespace (replace index with the relevant namespace index). For instance, {{PAGESINNAMESPACE:14}} will output the number of category pages. {{PAGESINNS:0}} differs from {{NUMBEROFARTICLES}} in that the former includes redirects and disambiguation pages. Disabled by default, enable with {{ #ifeq:
 dankwiki
MediaWiki $wgAllowSlowParserFunctions $wgAllowSlowParserFunctions

}}.

1.7+

Page names

Variable Output Description Versions
{{FULLPAGENAME}} Help:Magic words Namespace and page title. 1.6+
{{PAGENAME}} Magic words Page title.
{{BASEPAGENAME}} Magic words Page title excluding the current subpage and namespace ("Title/foo" on "Title/foo/bar").

For more complex splitting, use {{#titleparts:}} from ParserFunctions extension.

1.7+
{{SUBPAGENAME}} Magic words The subpage title ("foo" on "Title/foo"). 1.6+
{{SUBJECTPAGENAME}} Help:Magic words The namespace and title of the associated subject page. 1.7+
{{TALKPAGENAME}} Help talk:Magic words The namespace and title of the associated talk page. 1.7+

The {{BASEPAGENAME}} and {{SUBPAGENAME}} magic words only work in namespaces that have subpages enabled. See {{ #ifeq:

 dankwiki

| MediaWiki | Manual:$wgNamespacesWithSubpages | Manual:$wgNamespacesWithSubpages }} for information on enabling subpages.

The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters percent-encoded):

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

As of {{ #ifeq:

 dankwiki

| MediaWiki | 1.15+ | 1.15+ }}, these can all take a parameter, allowing specification of the page to be operated on, instead of just the current page:

  • {{PAGENAME:Template:Main Page}}Main Page

{{#if: Page titles containing certain characters, such as single quotes (') or asterisks *, may produce unexpected results when handled with these magic words, e.g. {{PAGESINCATEGORY:{{PAGENAME}}}}. See bugs {{ #ifeq:

 dankwiki

| MediaWiki | 14779 | 14779 }}, {{ #ifeq:

 dankwiki

| MediaWiki | 16474 | 16474

}}.|

}}Warning Warning: {{#if: Page titles containing certain characters, such as single quotes (') or asterisks *, may produce unexpected results when handled with these magic words, e.g. {{PAGESINCATEGORY:{{PAGENAME}}}}. See bugs {{ #ifeq:
 dankwiki

| MediaWiki | 14779 | 14779 }}, {{ #ifeq:

 dankwiki

| MediaWiki | 16474 | 16474

}}.|
Page titles containing certain characters, such as single quotes (') or asterisks *, may produce unexpected results when handled with these magic words, e.g. {{PAGESINCATEGORY:{{PAGENAME}}}}. See bugs {{ #ifeq:
 dankwiki

| MediaWiki | 14779 | 14779 }}, {{ #ifeq:

 dankwiki

| MediaWiki | 16474 | 16474

}}.

}}

Note that {{PAGENAME}}, {{PAGENAMEE}} and {{urlencode:}} have distinct implementations. See Manual:PAGENAMEE encoding for details.

Namespaces

Variable Output Description Versions
{{NAMESPACE}} Help Name of the page's namespace
{{SUBJECTSPACE}}
{{ARTICLESPACE}}
Help
Help
Name of the associated content namespace 1.7+
{{TALKSPACE}} Help talk Name of the associated talk namespace 1.7+

The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded):

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

As of {{ #ifeq:

 dankwiki

| MediaWiki | 1.15+ | 1.15+ }}, these can take a page name parameter and will return the namespace of the page name parameter, instead of the current page's:

  • {{NAMESPACE:Template:Main Page}}Template
  • {{SUBJECTSPACE:Template:Main Page}}Template
  • {{TALKSPACE:Template:Main Page}}Template talk

Parser functions

Parser functions are very similar to variables, but take one or more parameters (technically, any magic word that takes a parameter is a parser function), and the name is sometimes prefixed with a hash to distinguish them from templates.

This page only describes parser functions that are integral to the MediaWiki software. Other parser functions may be added by MediaWiki extensions such as the {{ #ifeq:

 dankwiki

| MediaWiki | ParserFunctions extension | ParserFunctions extension }}. For those see Help:Extension:ParserFunctions.

URL data

Parser function Input → Output Description Versions
{{localurl:page name}}
{{localurl:page name|query_string}}
{{localurl:MediaWiki}} → /dankwiki/index.php?title=MediaWiki
{{localurl:MediaWiki|printable=yes}} → /dankwiki/index.php?title=MediaWiki&printable=yes
The relative path to the title.
{{fullurl:page name}}
{{fullurl:page name|query_string}}
{{fullurl:interwiki:remote page name|query_string}}
{{fullurl:Category:Top level}}https://nick-black.com/dankwiki/index.php?title=Category:Top_level

{{fullurl:Category:Top level|action=edit}}https://nick-black.com/dankwiki/index.php?title=Category:Top_level&action=edit

The absolute path to the title. This will also resolve Interwiki prefixes. 1.5+
{{filepath:file name}}
{{filepath:file name|nowiki}}
{{filepath:Wiki.png}}

{{filepath:Wiki.png|nowiki}}
{{filepath:Example.svg|300}}300px-Example.svg.png

The absolute URL to the full size or thumbnail ({{ #ifeq:
 dankwiki
MediaWiki 1.18+ 1.18+

}}) of a media file.

{{ #ifeq:
 dankwiki
MediaWiki 1.12+ 1.12+

}}
{{ #ifeq:

 dankwiki
MediaWiki 1.18+ 1.18+

}}

{{urlencode:string}} (or {{urlencode:string|QUERY}})
{{urlencode:string|WIKI}}
{{urlencode:string|PATH}}
{{urlencode:x y z á é}} (or {{urlencode:x y z á é|QUERY}}) → x+y+z+%C3%A1+%C3%A9
{{urlencode:x y z á é|WIKI}} → x_y_z_%C3%A1_%C3%A9
{{urlencode:x y z á é|PATH}} → x%20y%20z%20%C3%A1%20%C3%A9

Note that the default changed from |WIKI to |QUERY in 1.17; this may break templates that rely on this function.

The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete Extension:StringFunctions. {{ #ifeq:
 dankwiki
MediaWiki 1.7+ 1.7+

}} (or {{ #ifeq:

 dankwiki
MediaWiki 1.17+ 1.17+

}})
{{ #ifeq:

 dankwiki
MediaWiki 1.17+ 1.17+

}}
{{ #ifeq:

 dankwiki
MediaWiki 1.17+ 1.17+

}}

{{anchorencode:string}} {{anchorencode:x y z á é}} → x_y_z_á_é The input encoded for use in URL section anchors (after the '#' symbol in a URL). {{ #ifeq:
 dankwiki
MediaWiki 1.8+ 1.8+

}}

Namespaces

{{ns:}} returns the localized name for the namespace with that index. {{nse:}} is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.

Content namespaces Talk namespaces
Usage Output Usage Output
{{ns:-2}} or {{ns:Media}} Media
{{ns:-1}} or {{ns:Special}} Special
{{ns:0}} or {{ns:}} {{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}} dankwiki {{ns:5}} or {{ns:Project talk}} dankwiki talk
{{ns:6}} or {{ns:File}} or {{ns:Image}} File {{ns:7}} or {{ns:File talk}} 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

Formatting

Usage Input → Output Description Version
{{lc:string}} {{lc:DATA CENTER}} → data center The lowercase input. 1.5+
{{lcfirst:string}} {{lcfirst:DATA center}} → dATA center The input with the very first character lowercase. 1.5+
{{uc:string}} {{uc:text transform}} → TEXT TRANSFORM The uppercase input. 1.5+
{{ucfirst:string}} {{ucfirst:text TRANSFORM}} → Text TRANSFORM The input with the very first character uppercase. 1.5+
{{formatnum:unformatted num}}
{{formatnum:formatted num|R}}
{{formatnum:987654321.654321}}
→ 987,654,321.654321
{{formatnum:987,654,321.654321|R}}
→ 987654321.654321
{{formatnum:00001}}
→ 00,001
}}Warning Warning: {{#if: |
}}Leading zeroes are not removed, you can use {{#expr:00001}} instead if you have Extension:ParserFunctions installed
1.7+
{{ #ifeq:
 dankwiki
MediaWiki 1.13+ 1.13+

}}

{{#dateformat:date}} {{#formatdate:date}} {{#dateformat:date|format}} {{#formatdate:date|format}}

{{#dateformat:25 deC 2009|ymd}}
2009 December 25 (your pref), 2009 DeC 25 (default)
{{#formatdate:dec 25,2009|dmy}}
25 December 2009 (your pref), 25 Dec 2009 (default)
{{#dateformat:2009-12-25|mdy}}
December 25, 2009 (your pref), December 25, 2009 (default)
{{#formatdate:2009 dec 25|ISO 8601}}
2009-12-25 (your pref), 2009-12-25 (default)
{{#dateformat:25 decEmber|mdy}}
December 25 (your pref), DecEmber 25 (default)


Note: In the example above, "your pref" refers to your date preference on the current MediaWiki wiki only.

}}Warning Warning: {{#if: |
}}Although the ISO 8601 standard requires that dates be in the Gregorian calendar, the ISO parameter in this function will still format dates that fall outside the usual Gregorian range (e.g. dates prior to 1583). Also, the magic word cannot properly convert between negative years (used with ISO 8601) and years BC or years BCE (used in general writing).
{{ #ifeq:
 dankwiki
MediaWiki 1.15+ 1.15+

}}

{{padleft:xyz|stringlength}}
{{padleft:xyz|strlen|char}}
{{padleft:xyz|strlen|string}}
{{padleft:xyz|5}} → 00xyz
{{padleft:xyz|5|_}} → __xyz {{padleft:xyz|5|abc}} → abxyz {{padleft:xyz|2}} → xyz
{{padleft:|1|xyz}} → x (first character of the string)
Inserts a string of padding characters (character chosen in third parameter; default '0') of a specified length (second parameter) next to a chosen base character or variable (first parameter). The final digits or characters in the base replace the final characters in the padding; i.e. {{padleft:44|3|0}} produces 044. The padding string may be truncated if its length does not evenly divide the required number of characters.
{{ #ifeq:
 dankwiki
MediaWiki bug bug

}} (fixed in {{ #ifeq:

 dankwiki
MediaWiki r45734 r45734

}}): multibyte characters are interpreted as two characters, which can skew width. These also cannot be used as padding characters.

1.8+
{{padright:xyz|stringlength}}
{{padright:xyz|strlen|char}}
{{padright:xyz|strlen|string}}
{{padright:xyz|5}} → xyz00

{{padright:xyz|5|_}} → xyz__ {{padright:xyz|5|abc}} → xyzab {{padright:xyz|2}} → xyz
{{padright:|1|xyz}} → x

Identical to padleft, but adds padding characters to the right side.
{{plural:2|is|are}} {{plural:0|is|are}} → are
{{plural:1*1|is|are}} → is
{{plural:21 mod 10|is|are}} → are
{{plural:{{#expr:21 mod 10}}|is|are}} → are
{{plural:1|is|are}} → is
{{plural:2|is|are}} → are
(for Polish):
{{plural:2|milion|miliony|milionów}} → miliony
Outputs the singular form (second parameter) if the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Plural transformations are used for languages like Russian based on "count mod 10". You should not expect this to handle fractions (like 44.5) — see bug 28128.
{{grammar:N|noun}} Outputs the correct inflected form of the given word described by the inflection code after the colon (language-dependent). Grammar transformations are used for inflected languages like Polish. See also {{ #ifeq:
 dankwiki
MediaWiki Manual:$wgGrammarForms Manual:$wgGrammarForms

}}.

1.7+

Miscellaneous

{{#if:{{#switch:Magic words |=Languages: |Languages=Languages: |MediaWiki=Languages: |af=Taal: |aln=Gjuha: |am=ቋምቋ፦ |an=Idioma: |ang=Sprǣc: |ar=:اللغة |arc=ܠܫܢܐ: |arn=Dungun: |arz=:اللغة |as=ভাষা: |ast=Llingua: |avk=Ava: |ay=Aru: |az=Dil: |bat-smg=Kalba: |bcc=:زبان |bcl=Tataramon: |be=Мова: |be-tarask=Мова: |bg=Език: |bn=ভাষা: |br=Yezh : |bs=Jezik: |ca=Llengua: |cdo=Ngṳ̄-ngiòng: |ce=Мотт: |ceb=Pinulongan: |ch=Lengguahe: |ckb-arab=:زمان |co=Lingua: |crh-cyrl=Тиль: |crh-latn=Til: |cs=Jazyk: |cu=ѩꙁꙑ́къ : |cv=Чĕлхе: |cy=Iaith: |da=Sprog: |de=Sprache: |diq=Zıwan: |dsb=Rěc: |ee=Gbe: |el=Γλώσσα: |en=Language: |eo=Lingvo: |es=Idioma: |et=Keel: |eu=Hizkuntza: |ext=Palra: |fa=:زبان |fi=Kieli: |fo=Mál: |fr=Langue: |frc=Langue: |frp=Lengoua: |fur=Lenghe: |fy=Taal: |ga=Teanga: |gag=Dil: |gan-hans=语言: |gan-hant=語言: |gl=Lingua: |gn=Ñe'ẽ: |got=Razda: |grc=Γλῶσσα: |gsw=Sproch: |gu=ભાષા: |gv=Çhengey: |hak=Ngî-ngièn: |haw=Kou 'ōlelo: |he=שפה: |hi=भाषा: |hif-latn=Bhasa: |hr=Jezik: |hsb=Rěč: |ht=Lang: |hu=Nyelv: |hy=Լեզու. |ia=Lingua: |id=Bahasa: |ie=Lingue: |ilo=Lengguahe: |io=Linguo: |is=Tungumál: |it=Lingua: |ja=言語: |jv=Basa: |ka=ენა: |kaa=Til: |kab=Tutlayt: |kg=Ndinga: |kiu=Zon: |kk-arab=:ٴتىل |kk-cyrl=Тіл: |kk-latn=Til: |km=ភាសា៖ |kn=ಭಾಷೆ: |ko=언어: |ksh=Sproch: |ku-latn=Ziman: |kv=Кыв: |kw=Yeth: |ky=Тил: |la=Lingua: |lb=Sprooch: |lfn=Lingua: |li=Taol: |lij=Lengoa: |loz=Zwa Siselect: |lt=Kalba: |lv=Valoda: |lzh=語: |mdf=Кяль: |mg=fiteny: |mhr=Йылме: |mk=Јазик: |ml=ഭാഷ: |mn=Хэл: |mr=भाषा: |ms=Bahasa: |mt=Lingwa: |mwl=Lhéngua: |my=ဘာသာ: |myv=Кель: |nah=Tlahtōlli: |nap=Lengua: |nds=Spraak: |nds-nl=Taal: |ne=भाषा: |new=भाषा: |nl=Taal: |nn=Språk: |no=Språk: |nso=Polelo: |oc=Lenga: |os=Æвзаг: |pa=ਭਾਸ਼ਾ: |pam=Amanu: |pdc=Schprooch: |pdt=Sproak: |pl=Język: |pms=Lenga: |pnb=بولی: |pnt=Γλώσσαν: |prg=Bilā: |ps=ژبه: |pt|pt-br=Língua: |qu=Rimay: |rm=Lingua: |ro=Limba: |roa-tara=Lénga: |ru=Язык: |sa=भाषा: |sah=Омугун тыла: |sc=Limba: |scn=Lingua: |sco=Leid: |sdc=Linga: |se=Giella: |sei=Itom: |sh=Jezik: |shi=tutlayt: |si=භාෂාව: |sk=Jazyk: |sl=Jezik: |sli=Sproache: |so=Luqada: |sq=Gjuha: |sr-ec=Језик: |sr-el=Jezik: |srn=Tongo: |ss=Lúlwîmi: |stq=Sproake: |su=Basa: |sv=Språk: |sw=Lugha: |szl=Godka: |ta=மொழி: |te=భాష: |tet=Lian: |tg-cyrl=Забон: |th=ภาษา: |ti=ቋንቋ: |tk=Dil: |tl=Wika: |to=Lea: |tr=Dil: |tt-cyrl=Тел: |tyv=Дыл: |ug-arab=:تىل |ug-latn=Til: |uk=Мова: |vec=Lengua: |vep=Kel’: |vi=Ngôn ngữ: |vo=Pük: |vro=Kiil: |wa=Lingaedje: |war=Yinaknan: |wo=Làkk: |wuu=语言: |xal=Келн: |xh=Ulwimi: |xmf=ნინა: |yi=שפראך: |yo=Èdè: |yue=語言: |zea=Taele: |zh-hans=语言: |zh-hant=語言: |zu=Ulimi: |#default=Language: }} | |

}}

{{#switch:Magic words |=Languages: |Languages=Languages: |MediaWiki=Languages: |af=Taal: |aln=Gjuha: |am=ቋምቋ፦ |an=Idioma: |ang=Sprǣc: |ar=:اللغة |arc=ܠܫܢܐ: |arn=Dungun: |arz=:اللغة |as=ভাষা: |ast=Llingua: |avk=Ava: |ay=Aru: |az=Dil: |bat-smg=Kalba: |bcc=:زبان |bcl=Tataramon: |be=Мова: |be-tarask=Мова: |bg=Език: |bn=ভাষা: |br=Yezh : |bs=Jezik: |ca=Llengua: |cdo=Ngṳ̄-ngiòng: |ce=Мотт: |ceb=Pinulongan: |ch=Lengguahe: |ckb-arab=:زمان |co=Lingua: |crh-cyrl=Тиль: |crh-latn=Til: |cs=Jazyk: |cu=ѩꙁꙑ́къ : |cv=Чĕлхе: |cy=Iaith: |da=Sprog: |de=Sprache: |diq=Zıwan: |dsb=Rěc: |ee=Gbe: |el=Γλώσσα: |en=Language: |eo=Lingvo: |es=Idioma: |et=Keel: |eu=Hizkuntza: |ext=Palra: |fa=:زبان |fi=Kieli: |fo=Mál: |fr=Langue: |frc=Langue: |frp=Lengoua: |fur=Lenghe: |fy=Taal: |ga=Teanga: |gag=Dil: |gan-hans=语言: |gan-hant=語言: |gl=Lingua: |gn=Ñe'ẽ: |got=Razda: |grc=Γλῶσσα: |gsw=Sproch: |gu=ભાષા: |gv=Çhengey: |hak=Ngî-ngièn: |haw=Kou 'ōlelo: |he=שפה: |hi=भाषा: |hif-latn=Bhasa: |hr=Jezik: |hsb=Rěč: |ht=Lang: |hu=Nyelv: |hy=Լեզու. |ia=Lingua: |id=Bahasa: |ie=Lingue: |ilo=Lengguahe: |io=Linguo: |is=Tungumál: |it=Lingua: |ja=言語: |jv=Basa: |ka=ენა: |kaa=Til: |kab=Tutlayt: |kg=Ndinga: |kiu=Zon: |kk-arab=:ٴتىل |kk-cyrl=Тіл: |kk-latn=Til: |km=ភាសា៖ |kn=ಭಾಷೆ: |ko=언어: |ksh=Sproch: |ku-latn=Ziman: |kv=Кыв: |kw=Yeth: |ky=Тил: |la=Lingua: |lb=Sprooch: |lfn=Lingua: |li=Taol: |lij=Lengoa: |loz=Zwa Siselect: |lt=Kalba: |lv=Valoda: |lzh=語: |mdf=Кяль: |mg=fiteny: |mhr=Йылме: |mk=Јазик: |ml=ഭാഷ: |mn=Хэл: |mr=भाषा: |ms=Bahasa: |mt=Lingwa: |mwl=Lhéngua: |my=ဘာသာ: |myv=Кель: |nah=Tlahtōlli: |nap=Lengua: |nds=Spraak: |nds-nl=Taal: |ne=भाषा: |new=भाषा: |nl=Taal: |nn=Språk: |no=Språk: |nso=Polelo: |oc=Lenga: |os=Æвзаг: |pa=ਭਾਸ਼ਾ: |pam=Amanu: |pdc=Schprooch: |pdt=Sproak: |pl=Język: |pms=Lenga: |pnb=بولی: |pnt=Γλώσσαν: |prg=Bilā: |ps=ژبه: |pt|pt-br=Língua: |qu=Rimay: |rm=Lingua: |ro=Limba: |roa-tara=Lénga: |ru=Язык: |sa=भाषा: |sah=Омугун тыла: |sc=Limba: |scn=Lingua: |sco=Leid: |sdc=Linga: |se=Giella: |sei=Itom: |sh=Jezik: |shi=tutlayt: |si=භාෂාව: |sk=Jazyk: |sl=Jezik: |sli=Sproache: |so=Luqada: |sq=Gjuha: |sr-ec=Језик: |sr-el=Jezik: |srn=Tongo: |ss=Lúlwîmi: |stq=Sproake: |su=Basa: |sv=Språk: |sw=Lugha: |szl=Godka: |ta=மொழி: |te=భాష: |tet=Lian: |tg-cyrl=Забон: |th=ภาษา: |ti=ቋንቋ: |tk=Dil: |tl=Wika: |to=Lea: |tr=Dil: |tt-cyrl=Тел: |tyv=Дыл: |ug-arab=:تىل |ug-latn=Til: |uk=Мова: |vec=Lengua: |vep=Kel’: |vi=Ngôn ngữ: |vo=Pük: |vro=Kiil: |wa=Lingaedje: |war=Yinaknan: |wo=Làkk: |wuu=语言: |xal=Келн: |xh=Ulwimi: |xmf=ნინა: |yi=שפראך: |yo=Èdè: |yue=語言: |zea=Taele: |zh-hans=语言: |zh-hant=語言: |zu=Ulimi: |#default=Language: }} English {{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/af |  • {{#if: |Afrikaans| Afrikaans}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ar |  • {{#if: |العربية| العربية}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ast |  • {{#if: |asturianu| asturianu}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/az |  • {{#if: |azərbaycanca| azərbaycanca}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/bcc |  • {{#if: |جهلسری بلوچی| جهلسری بلوچی}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/bg |  • {{#if: |български| български}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/br |  • {{#if: |brezhoneg| brezhoneg}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ca |  • {{#if: |català| català}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/cs |  • {{#if: |čeština| čeština}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/da |  • {{#if: |dansk| dansk}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/de |  • {{#if: |Deutsch| Deutsch}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/el |  • {{#if: |Ελληνικά| Ελληνικά}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/eo |  • {{#if: |Esperanto| Esperanto}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/es |  • {{#if: |español| español}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/fa |  • {{#if: |فارسی| فارسی}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/fi |  • {{#if: |suomi| suomi}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/fr |  • {{#if: |français| français}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/gl |  • {{#if: |galego| galego}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/gu |  • {{#if: |ગુજરાતી| ગુજરાતી}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/he |  • {{#if: |עברית| עברית}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/hu |  • {{#if: |magyar| magyar}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/id |  • {{#if: |Bahasa Indonesia| Bahasa Indonesia}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/it |  • {{#if: |italiano| italiano}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ja |  • {{#if: |日本語| 日本語}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ka |  • {{#if: |ქართული| ქართული}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ko |  • {{#if: |한국어| 한국어}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ksh |  • {{#if: |Ripoarisch| Ripoarisch}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/kw |  • {{#if: |kernowek| kernowek}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/mk |  • {{#if: |македонски| македонски}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ml |  • {{#if: |മലയാളം| മലയാളം}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/mr |  • {{#if: |मराठी| मराठी}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ms |  • {{#if: |Bahasa Melayu| Bahasa Melayu}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/nl |  • {{#if: |Nederlands| Nederlands}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/no |  • {{#if: |norsk| norsk}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/oc |  • {{#if: |occitan| occitan}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/pl |  • {{#if: |polski| polski}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/pt |  • {{#if: |português| português}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/pt-br |  • {{#if: |português do Brasil| português do Brasil}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ro |  • {{#if: |română| română}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ru |  • {{#if: |русский| русский}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/si |  • {{#if: |සිංහල| සිංහල}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/sk |  • {{#if: |slovenčina| slovenčina}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/sl |  • {{#if: |slovenščina| slovenščina}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/sq |  • {{#if: |shqip| shqip}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/sr |  • {{#if: |српски / srpski| српски / srpski}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/sv |  • {{#if: |svenska| svenska}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/ta |  • {{#if: |தமிழ்| தமிழ்}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/th |  • {{#if: |ไทย| ไทย}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/tr |  • {{#if: |Türkçe| Türkçe}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/uk |  • {{#if: |українська| українська}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/vi |  • {{#if: |Tiếng Việt| Tiếng Việt}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/yue |  • {{#if: |粵語| 粵語}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/zh |  • {{#if: |中文| 中文}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/zh-hans |  • {{#if: |中文(简体)| 中文(简体)}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/zh-hant |  • {{#if: |中文(繁體)| 中文(繁體)}}|}}{{#ifexist: {{#if: | | {{#if: Help | Help:}}Magic words}}/zh-tw |  • {{#if: |中文(臺灣)| 中文(臺灣)}}|}}