Difference between revisions of "Help:Magic words"

From APBWiki
Jump to navigation Jump to search
(more link fixage)
 
Line 2: Line 2:
  
 
== Table of contents ==
 
== Table of contents ==
:''For details see [[Help:Section]]''  
+
:''For details look it up with Google or at Mediawiki or Wikipedia.''  
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" width="79%"
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" width="79%"
 
! Word  
 
! Word  
Line 45: Line 45:
  
 
== Variables ==
 
== Variables ==
:''For details see [[Help:Variable]]''
+
:''For details look it up with Google or at Mediawiki or Wikipedia.''
  
 
===Time===  
 
===Time===  
The time in [[:en:UTC|UTC]].
+
The time in UTC.
 
{| class="wikitable sortable" border="2" cellpadding="4" cellspacing="0"  
 
{| class="wikitable sortable" border="2" cellpadding="4" cellspacing="0"  
 
! Word  
 
! Word  
Line 101: Line 101:
 
| <code>{{CURRENTTIMESTAMP}}</code>
 
| <code>{{CURRENTTIMESTAMP}}</code>
 
| '''[MW1.7+]''' [[w:en:ISO 8601|ISO 8601]] time stamp.
 
| '''[MW1.7+]''' [[w:en:ISO 8601|ISO 8601]] time stamp.
|}{{-}}
+
|}
  
 
===Local time===  
 
===Local time===  
Line 157: Line 157:
 
| <code>{{LOCALTIMESTAMP}}</code>
 
| <code>{{LOCALTIMESTAMP}}</code>
 
| [[w:en:ISO 8601|ISO 8601]] time stamp.
 
| [[w:en:ISO 8601|ISO 8601]] time stamp.
|}{{-}}
+
|}
  
*See also the [[ParserFunctions#.23time:|ParserFunction #time:]]
+
*See also the ParserFunction #time: (Again, look it up elsewhere.)
  
 
=== Statistics ===
 
=== Statistics ===
Line 169: Line 169:
 
| <nowiki>{{CURRENTVERSION}}</nowiki>
 
| <nowiki>{{CURRENTVERSION}}</nowiki>
 
| <code>{{CURRENTVERSION}}</code>
 
| <code>{{CURRENTVERSION}}</code>
| '''[MW1.7+]''' {{h:mwg|Version}} [http://mail.wikipedia.org/pipermail/mediawiki-i18n/2006-May/000026.html]
+
| '''[MW1.7+]''' [http://mail.wikipedia.org/pipermail/mediawiki-i18n/2006-May/000026.html]
 
|-
 
|-
 
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br /><nowiki>{{NUMBEROFARTICLES:R}}</nowiki>
 
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br /><nowiki>{{NUMBEROFARTICLES:R}}</nowiki>
 
| <code>{{NUMBEROFARTICLES}}</code><br /><code>{{NUMBEROFARTICLES:R}}</code>
 
| <code>{{NUMBEROFARTICLES}}</code><br /><code>{{NUMBEROFARTICLES:R}}</code>
| A [[Help:Variable|variable]] which returns the total number of articles on the Wiki.
+
| A variable which returns the total number of articles on the Wiki.
 
|-
 
|-
 
| <nowiki>{{NUMBEROFPAGES}}</nowiki><br /><nowiki>{{NUMBEROFPAGES:R}}</nowiki>
 
| <nowiki>{{NUMBEROFPAGES}}</nowiki><br /><nowiki>{{NUMBEROFPAGES:R}}</nowiki>
Line 192: Line 192:
 
|-
 
|-
 
| <nowiki>{{PAGESINNAMESPACE}}</nowiki>
 
| <nowiki>{{PAGESINNAMESPACE}}</nowiki>
| &#160;{{#if:{{#ifexpr:{{PAGEINNS:0|R}}}}|<font color="red">'''disabled here'''</font>}}
+
| <font color="red">'''disabled here'''</font>
 
| Longer alias of PAGESINNS
 
| Longer alias of PAGESINNS
 
|-
 
|-
 
| <nowiki>{{PAGESINNS:ns}}</nowiki><br /><nowiki>{{PAGESINNS:ns:R}}</nowiki>
 
| <nowiki>{{PAGESINNS:ns}}</nowiki><br /><nowiki>{{PAGESINNS:ns:R}}</nowiki>
| <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>}}
+
| <font color="red">'''disabled here'''</font>
| '''[MW1.7+]''' Returns the number of pages in the given namespace. Disabled by default, enable with {{h:mwg|AllowSlowParserFunctions}}.
+
| '''[MW1.7+]''' Returns the number of pages in the given namespace. Disabled by default, enable with AllowSlowParserFunctions.
|}{{-}}
+
|}
  
 
=== Page names and related info ===
 
=== Page names and related info ===
Line 216: Line 216:
 
| <nowiki>{{SUBPAGENAME}}</nowiki><br /><nowiki>{{SUBPAGENAMEE}}</nowiki>
 
| <nowiki>{{SUBPAGENAME}}</nowiki><br /><nowiki>{{SUBPAGENAMEE}}</nowiki>
 
| <code>{{SUBPAGENAME}}<br />{{SUBPAGENAMEE}}</code>
 
| <code>{{SUBPAGENAME}}<br />{{SUBPAGENAMEE}}</code>
| '''[MW1.6+]''' Name of the current page, excluding parent pages ("Subtitle" on "Title/Other/Subtitle") in namespaces supporting subpages, see [[Help:Link#Subpage_feature|Help:Link]].
+
| '''[MW1.6+]''' Name of the current page, excluding parent pages ("Subtitle" on "Title/Other/Subtitle") in namespaces supporting subpages, see [[Help:Links|Help:Links]].
 
|-
 
|-
 
| <nowiki>{{BASEPAGENAME}}</nowiki><br ><nowiki>{{BASEPAGENAMEE}}</nowiki>
 
| <nowiki>{{BASEPAGENAME}}</nowiki><br ><nowiki>{{BASEPAGENAMEE}}</nowiki>
 
| <code>{{BASEPAGENAME}}<br />{{BASEPAGENAMEE}}</code>
 
| <code>{{BASEPAGENAME}}<br />{{BASEPAGENAMEE}}</code>
| '''[MW1.7+]''' The basename of a subpage ("Title/Other" on "Title/Other/Subtitle"), see [[Help:Link#Subpage_feature|Help:Link]].
+
| '''[MW1.7+]''' The basename of a subpage ("Title/Other" on "Title/Other/Subtitle"), see [[Help:Links|Help:Links]].
 
|-
 
|-
 
| <nowiki>{{NAMESPACE}}</nowiki><br /><nowiki>{{NAMESPACEE}}</nowiki>
 
| <nowiki>{{NAMESPACE}}</nowiki><br /><nowiki>{{NAMESPACEE}}</nowiki>
Line 256: Line 256:
 
| <nowiki>{{REVISIONID}}</nowiki>
 
| <nowiki>{{REVISIONID}}</nowiki>
 
| <code>{{REVISIONID}}</code>
 
| <code>{{REVISIONID}}</code>
| '''[MW1.5+]''' The unique identifying number of a page, see [[Help:Diff]].
+
| '''[MW1.5+]''' The unique identifying number of a page revision.
 
|-
 
|-
 
| <nowiki>{{REVISIONDAY}}</nowiki>
 
| <nowiki>{{REVISIONDAY}}</nowiki>
Line 280: Line 280:
 
| <nowiki>{{SITENAME}}</nowiki>
 
| <nowiki>{{SITENAME}}</nowiki>
 
| <code>{{SITENAME}}</code>
 
| <code>{{SITENAME}}</code>
| Value of {{h:mwg|Sitename}}.
+
| As given in config file.
 
|-
 
|-
 
| <nowiki>{{SERVER}}</nowiki>
 
| <nowiki>{{SERVER}}</nowiki>
 
| <small>{{SERVER}}</small>
 
| <small>{{SERVER}}</small>
| Value of {{h:mwg|Server}} 
+
| As given in config file.
 
|-
 
|-
 
| <nowiki>{{SCRIPTPATH}}</nowiki>
 
| <nowiki>{{SCRIPTPATH}}</nowiki>
 
| <code>{{SCRIPTPATH}}</code>
 
| <code>{{SCRIPTPATH}}</code>
| '''[MW1.5+]''' {{h:mwg|ScriptPath}}
+
| '''[MW1.5+]''' As given in config file.
 
|-
 
|-
 
| <nowiki>{{SERVERNAME}}</nowiki>
 
| <nowiki>{{SERVERNAME}}</nowiki>
 
| <code>{{SERVERNAME}}</code>
 
| <code>{{SERVERNAME}}</code>
| '''[MW1.5+]''' {{h:mwg|ServerName}}
+
| '''[MW1.5+]''' As given in config file.
 
|-
 
|-
|}{{-}}
+
|}
  
 
==Parser functions==
 
==Parser functions==
  
:''For details see [[Help:Parser function]].''
+
:''For details blah blah blah''
  
 
=== Namespaces and URLs ===
 
=== Namespaces and URLs ===
Line 308: Line 308:
 
| <nowiki>{{ns:}}</nowiki>
 
| <nowiki>{{ns:}}</nowiki>
 
| <nowiki>{{ns:4}}</nowiki> = <code>{{ns:4}}</code><br /><nowiki>{{ns:project}}</nowiki> = <code>{{ns:project}}</code>
 
| <nowiki>{{ns:4}}</nowiki> = <code>{{ns:4}}</code><br /><nowiki>{{ns:project}}</nowiki> = <code>{{ns:project}}</code>
| Returns the name of a given [[Help:Namespace|namespace number]].
+
| Returns the name of a given namespace number.
 
|-
 
|-
 
| <nowiki>{{localurl:x y @}}</nowiki><br /><nowiki>{{localurle:x y @}}</nowiki><br /><nowiki>{{localurl:a|b=c}}</nowiki>
 
| <nowiki>{{localurl:x y @}}</nowiki><br /><nowiki>{{localurle:x y @}}</nowiki><br /><nowiki>{{localurl:a|b=c}}</nowiki>
 
| <code>{{localurl:x y @}}<br />{{localurle:x y @}}<br />{{localurl:a|b=c}}</code>
 
| <code>{{localurl:x y @}}<br />{{localurle:x y @}}<br />{{localurl:a|b=c}}</code>
| Returns the local URL of a page (might not exist). Optional ''query'' parameter, see [[Help:Variable]].
+
| Returns the local URL of a page (might not exist). Optional ''query'' parameter.
 
|- <!-- intentionally nbsp instead of sp for formatting reasons -->
 
|- <!-- intentionally nbsp instead of sp for formatting reasons -->
 
| <nowiki>{{urlencode:x&#160;y&#160;@}}</nowiki>
 
| <nowiki>{{urlencode:x&#160;y&#160;@}}</nowiki>
Line 325: Line 325:
 
| <small>{{fullurl:x y @}}<br />{{fullurle:x y @}}<br />{{fullurl:m:a|b=c}}</small>
 
| <small>{{fullurl:x y @}}<br />{{fullurle:x y @}}<br />{{fullurl:m:a|b=c}}</small>
 
| '''[MW1.5+]''' Returns the full URL of a given page. Optional ''query'' parameter as for <tt>localurl:</tt>.
 
| '''[MW1.5+]''' Returns the full URL of a given page. Optional ''query'' parameter as for <tt>localurl:</tt>.
|}{{-}}
+
|}
  
 
=== Formatting ===
 
=== Formatting ===
Line 360: Line 360:
 
| <nowiki>{{padleft:bcd|6|a}}</nowiki> = <code>{{padleft:bcd|6|a}}</code><br /><nowiki>{{padright:bcd|6|a}}</nowiki> = <code>{{padright:bcd|6|a}}</code>
 
| <nowiki>{{padleft:bcd|6|a}}</nowiki> = <code>{{padleft:bcd|6|a}}</code><br /><nowiki>{{padright:bcd|6|a}}</nowiki> = <code>{{padright:bcd|6|a}}</code>
 
| '''[MW1.8+]''' Pads a string with a character to the specified width.
 
| '''[MW1.8+]''' Pads a string with a character to the specified width.
|}{{-}}
+
|}
  
Padding does not seem to work for characters with a multi-character code, such as &amp;nbsp;, which would be useful with padleft for [[Help:Sorting|sorting tables]] with Javascript.
+
Padding does not seem to work for characters with a multi-character code, such as &amp;nbsp;, which would be useful with padleft for sorting tables with Javascript.
  
 
== Template modifiers ==
 
== Template modifiers ==
Line 373: Line 373:
 
|-
 
|-
 
| <nowiki>{{int:xyz}}</nowiki>
 
| <nowiki>{{int:xyz}}</nowiki>
| Shorthand for <nowiki>{{MediaWiki:xyz}}</nowiki>, rendered as {{int:xyz}} if [[MediaWiki:xyz]] doesn't exist. See [[Help:MediaWiki namespace]].
+
| Shorthand for <nowiki>{{MediaWiki:xyz}}</nowiki>, rendered as {{int:xyz}} if <nowiki>[[MediaWiki:xyz]]</nowiki> doesn't exist.
 
|-
 
|-
 
| <nowiki>{{msg:xyz}}</nowiki>
 
| <nowiki>{{msg:xyz}}</nowiki>
Line 379: Line 379:
 
|-
 
|-
 
| <nowiki>{{msgnw:xyz}}</nowiki>
 
| <nowiki>{{msgnw:xyz}}</nowiki>
| The unevaluated wikitext is rendered. See [[Help:Template#msgnw|msgnw]].
+
| The unevaluated wikitext is rendered. Look up msgnw.
 
|-
 
|-
 
| <nowiki>{{raw:xyz}}</nowiki>
 
| <nowiki>{{raw:xyz}}</nowiki>
Line 385: Line 385:
 
|-
 
|-
 
| <nowiki>{{subst:xyz}}</nowiki>
 
| <nowiki>{{subst:xyz}}</nowiki>
| In the wikitext, the tag is substituted by the ''content'' (single-level evaluation only), see [[Help:Substitution]].
+
| In the wikitext, the tag is substituted by the ''content'' (single-level evaluation only).
|}{{-}}
+
|}
  
 
== Image modifiers ==
 
== Image modifiers ==
 
:''For details see [[w:en:Wikipedia:Extended image syntax]].''
 
:''For details see [[w:en:Wikipedia:Extended image syntax]].''
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.
+
These are image modifiers used in <code><nowiki>[[Image:title.ext|modifier|...|modifier]]</nowiki></code> links. Some are mutually exclusive, and then the last specified wins.
  
 
=== Size ===
 
=== Size ===
Line 414: Line 414:
 
| <nowiki>[[Image:Mediawiki.png|40px]]</nowiki>
 
| <nowiki>[[Image:Mediawiki.png|40px]]</nowiki>
 
| Scales image to given ''width''&#160; in pixels
 
| Scales image to given ''width''&#160; in pixels
|}{{-}}
+
|}
  
 
=== Position ===
 
=== 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.
 
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%"
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" width="100%"
Line 439: Line 438:
 
| <nowiki>[[Image:Mediawiki.png|center]]</nowiki>
 
| <nowiki>[[Image:Mediawiki.png|center]]</nowiki>
 
| Modifies position, like ''none'' but centered.  
 
| Modifies position, like ''none'' but centered.  
|}{{-}}
+
|}
  
 
== Miscellany ==
 
== Miscellany ==
Line 450: Line 449:
 
| <nowiki>{{DISPLAYTITLE:</nowiki>''xyz''<nowiki>}}</nowiki>
 
| <nowiki>{{DISPLAYTITLE:</nowiki>''xyz''<nowiki>}}</nowiki>
 
| <font color="red">'''default disabled'''</font>
 
| <font color="red">'''default disabled'''</font>
| '''[MW 1.7+]''' Set the page's title [http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=13572], see {{h:mwg|AllowDisplayTitle}}.
+
| '''[MW 1.7+]''' Set the page's title [http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=13572], see AllowDisplayTitle.
 
|-
 
|-
 
| <nowiki>{{DIRMARK}}</nowiki><br /><nowiki>{{DIRECTIONMARK}}</nowiki>
 
| <nowiki>{{DIRMARK}}</nowiki><br /><nowiki>{{DIRECTIONMARK}}</nowiki>
Line 458: Line 457:
 
| <nowiki>{{CONTENTLANGUAGE}}</nowiki>
 
| <nowiki>{{CONTENTLANGUAGE}}</nowiki>
 
| <code>{{CONTENTLANGUAGE}}</code>
 
| <code>{{CONTENTLANGUAGE}}</code>
| '''[MW1.7+]''' Default content {{h:mwg|LanguageCode}}
+
| '''[MW1.7+]''' Default content LanguageCode
 
|-
 
|-
 
| <nowiki>#redirect</nowiki>  
 
| <nowiki>#redirect</nowiki>  
 
| <code>#REDIRECT&#160;[&#91;target&#93;]</code><br />at top of source page
 
| <code>#REDIRECT&#160;[&#91;target&#93;]</code><br />at top of source page
| Creates a [[Help:Redirect|redirect]] to another page.
+
| Creates a redirect to another page.
|}{{-}}
+
|}
  
 
===Language-dependent word conversions===
 
===Language-dependent word conversions===
Line 476: Line 475:
 
|-
 
|-
 
| {&#123;grammar:''case &#124; word'' &#125;}  
 
| {&#123;grammar:''case &#124; word'' &#125;}  
| <nowiki>{{grammar:7sg|Wikipedie}}</nowiki><br />on [[:cs:]] is <code>Wikipedií</code>.
+
| <nowiki>{{grammar:7sg|Wikipedie}}</nowiki><br />on cs is <code>Wikipedií</code>.
| Derived word forms in inflected languages like [[:cs:|Czech]] [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/LanguageCs.php]
+
| Derived word forms in inflected languages like Czech [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/LanguageCs.php]
 
|-
 
|-
 
| {&#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;}  
 
| {&#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;}  
 
| <nowiki>{{plural: 2 | is | are }}</nowiki><br />outputs <code>{{plural: 2 | is |are }}</code><br /><nowiki>{{plural: 0 | this | these }}</nowiki><br />outputs <code>{{plural: 0 |this | these }}</code>
 
| <nowiki>{{plural: 2 | is | are }}</nowiki><br />outputs <code>{{plural: 2 | is |are }}</code><br /><nowiki>{{plural: 0 | this | these }}</nowiki><br />outputs <code>{{plural: 0 |this | these }}</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/LanguageRu.php] based on "count mod 10".
+
| ''count'' '''1''' yields ''form1'' (singular), [[w:Plural|plural]] transformations are used for languages like Russian [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/LanguageRu.php] based on "count mod 10".
|}{{-}}
+
|}
  
 
"Grammar" and "Plural" are language-dependent functions, defined in [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/LanguageCs.php], [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/LanguageRu.php], etc. (note that in PHP, the modulo operator is the percent sign).
 
"Grammar" and "Plural" are language-dependent functions, defined in [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/LanguageCs.php], [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/LanguageRu.php], etc. (note that in PHP, the modulo operator is the percent sign).
  
"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]].
+
"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.
  
 
"Plural" is a project-dependent switch function, e.g. giving the first text if ''count'' = 1, the second if ''count'' = 2,3, or 4, and else the third.
 
"Plural" is a project-dependent switch function, e.g. giving the first text if ''count'' = 1, the second if ''count'' = 2,3, or 4, and else the third.
Line 492: Line 491:
  
 
===See also===
 
===See also===
*[[m:ParserFunctions|Parser functions]] '''#expr:''', '''#if:''', '''#ifeq:''', etc.
+
*Parser functions '''#expr:''', '''#if:''', '''#ifeq:''', etc.
 
*[http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/Language.php Source for Language.php]
 
*[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]
 
*[http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/includes/MagicWord.php Source for MagicWord.php]
 
{{H:f|enname=Magic words}}
 

Latest revision as of 19:54, January 3, 2007

This is an organised index of Magic words used in MediaWiki. Tags such as "[MW1.5+]" indicate the version that first supported the magic word. "XYZ" indicates user input, which is used in the example.

Table of contents

For details look it up with Google or at Mediawiki or Wikipedia.
Word Explanation
__NOTOC__ Hides ToC on the current page.
__FORCETOC__ Forces the table of contents to appear.
__TOC__ Places a ToC here (overriding any __NOTOC__).


More magic

Word Explanation
__NOEDITSECTION__ Hides the edit links beside headings.
__NEWSECTIONLINK__ [MW1.7+] Gives a "+"-link next to the edit-tab to make a new section on a non-talk page.
__NOCONTENTCONVERT__
__NOCC__
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.
__NOGALLERY__ [MW1.7+] This magic word allows images in category pages to be displayed as inline links instead of gallery.
__NOTITLECONVERT__
__NOTC__
Like __NOCC__ but affecting article title only.
__END__ Allows for trailing whitespace to be included in the page save.
__START__ This magic word has no effect but an ID in MagicWord.php (MAG_START).


Variables

For details look it up with Google or at Mediawiki or Wikipedia.

Time

The time in UTC.

Word Example Explanation
{{CURRENTDAY}} 5 Displays the current day in numeric form.
{{CURRENTDAY2}} 05 [MW1.6+] Same as {{CURRENTDAY}}, but with leading zero (01 .. 31).
{{CURRENTDAYNAME}} Friday Name of the day in the language of the project or English.
{{CURRENTDOW}} 5 Same as {{CURRENTDAYNAME}}, but as a number (0=Sunday, 1=Monday...).
{{CURRENTMONTH}} 12 The number 01 .. 12 of the month.
{{CURRENTMONTHABBREV}} Dec [MW1.5+] Same as {{CURRENTMONTH}}, but in abbreviated form as Jan .. Dec.
{{CURRENTMONTHNAME}} December Same as {{CURRENTMONTH}}, but in named form January .. December.
{{CURRENTTIME}} 15:26 The current time (00:00 .. 23:59).
{{CURRENTHOUR}} 15 The current hour (00 .. 23).
{{CURRENTWEEK}} 49 Number of the current week (1-53) according to ISO 8601 with no leading zero.
{{CURRENTYEAR}} 2025 Returns the current year.
{{CURRENTTIMESTAMP}} 20251205152631 [MW1.7+] ISO 8601 time stamp.

Local time

The time depending on the local timezone of the wiki. (All words [MW1.8+] )

Word Example Explanation
{{LOCALDAY}} 5 Displays the local day of the month in numeric form.
{{LOCALDAY2}} 05 Same as {{LOCALDAY}}, but with a leading zero (01 .. 31).
{{LOCALDAYNAME}} Friday Name of the day in the language of the project or English.
{{LOCALDOW}} 5 Same as {{LOCALDAYNAME}}, but as a number (0=Sunday, 1=Monday...).
{{LOCALMONTH}} 12 The number 01 .. 12 of the month.
{{LOCALMONTHABBREV}} Dec Same as {{LOCALMONTH}}, but in abbreviated form as Jan .. Dec.
{{LOCALMONTHNAME}} December Same as {{LOCALMONTH}}, but in named form as January .. December.
{{LOCALTIME}} 07:26 The local time (00:00 .. 23:59).
{{LOCALHOUR}} 07 The local hour (00 .. 23).
{{LOCALWEEK}} 49 Number of the local week (1-53) according to ISO 8601 with no leading zero.
{{LOCALYEAR}} 2025 Returns the local year.
{{LOCALTIMESTAMP}} 20251205072631 ISO 8601 time stamp.
  • See also the ParserFunction #time: (Again, look it up elsewhere.)

Statistics

Word Example Explanation
{{CURRENTVERSION}} 1.35.11 [MW1.7+] [1]
{{NUMBEROFARTICLES}}
{{NUMBEROFARTICLES:R}}
1,158
1158
A variable which returns the total number of articles on the Wiki.
{{NUMBEROFPAGES}}
{{NUMBEROFPAGES:R}}
2,220
2220
[MW1.7+] Returns the total number of pages. [2]
{{NUMBEROFFILES}}
{{NUMBEROFFILES:R}}
183
183
[MW1.5+] Returns the number of uploaded files (rows in the image table).
{{NUMBEROFUSERS}}
{{NUMBEROFUSERS:R}}
101
101
[MW1.7+] Returns the number of registered users (rows in the user table).
{{NUMBEROFADMINS}}
{{NUMBEROFADMINS:R}}
5
5
[MW1.7+] Returns the number of administrators (sysop, bureaucrat, steward and checkuser).
{{PAGESINNAMESPACE}} disabled here Longer alias of PAGESINNS
{{PAGESINNS:ns}}
{{PAGESINNS:ns:R}}
disabled here [MW1.7+] Returns the number of pages in the given namespace. Disabled by default, enable with AllowSlowParserFunctions.

Page names and related info

Word Example Explanation
{{PAGENAME}} Magic words Returns the name of the current page, including all levels (Title/Subtitle).
{{PAGENAMEE}} Magic_words More URL-friendly percent encoded special characters (To use an articlename in an external link).
{{SUBPAGENAME}}
{{SUBPAGENAMEE}}
Magic words
Magic_words
[MW1.6+] Name of the current page, excluding parent pages ("Subtitle" on "Title/Other/Subtitle") in namespaces supporting subpages, see Help:Links.
{{BASEPAGENAME}}
{{BASEPAGENAMEE}}
Magic words
Magic_words
[MW1.7+] The basename of a subpage ("Title/Other" on "Title/Other/Subtitle"), see Help:Links.
{{NAMESPACE}}
{{NAMESPACEE}}
Help
Help
Returns the name of the namespace the current page resides in.
{{FULLPAGENAME}}
{{FULLPAGENAMEE}}
Help:Magic words
Help:Magic_words
[MW1.6+] Shorthands for NAMESPACE+PAGENAME
{{TALKSPACE}}
{{TALKSPACEE}}
Help talk
Help_talk
[MW1.7+] Name of next odd namespace (e.g. 4 => 5)
{{SUBJECTSPACE}}
{{SUBJECTSPACEE}}
Help
Help
[MW1.7+] Name of last even namespace (e.g. 5 => 4)
{{ARTICLESPACE}}
{{ARTICLESPACEE}}
Help
Help
[MW1.7+] An alias for SUBJECTSPACE(E)
{{TALKPAGENAME}}
{{TALKPAGENAMEE}}
Help talk:Magic words
Help_talk:Magic_words
[MW1.7+] FULLPAGENAME in its TALKSPACE
{{SUBJECTPAGENAME}}
{{SUBJECTPAGENAMEE}}
Help:Magic words
Help:Magic_words
[MW1.7+] FULLPAGENAME in its SUBJECTSPACE
{{ARTICLEPAGENAME}}
{{ARTICLEPAGENAMEE}}
Help:Magic words
Help:Magic_words
[MW1.7+] An alias for SUBJECTPAGENAME(E)
{{REVISIONID}} 2221 [MW1.5+] The unique identifying number of a page revision.
{{REVISIONDAY}} 3 [MW1.8+] The day on which the page was last modified.
{{REVISIONDAY2}} 03 [MW1.8+] The day on which the page was last modified, but with a leading zero (01 .. 31).
{{REVISIONMONTH}} 01 [MW1.8+] The month in which the page was last modified.
{{REVISIONYEAR}} 2007 [MW1.8+] The year in which the page was last modified.
{{REVISIONTIMESTAMP}} 20070103195451 [MW1.8+] ISO 8601 time stamp, indicating when the page was last modified.
{{SITENAME}} APBWiki As given in config file.
{{SERVER}} http://apbwiki.rpipepbandalumni.org As given in config file.
{{SCRIPTPATH}} [MW1.5+] As given in config file.
{{SERVERNAME}} apbwiki.rpipepbandalumni.org [MW1.5+] As given in config file.

Parser functions

For details blah blah blah

Namespaces and URLs

Word Example Explanation
{{ns:}} {{ns:4}} = APBWiki
{{ns:project}} = APBWiki
Returns the name of a given namespace number.
{{localurl:x y @}}
{{localurle:x y @}}
{{localurl:a|b=c}}
/X_y_@
/X_y_@
/index.php?title=A&b=c
Returns the local URL of a page (might not exist). Optional query parameter.
{{urlencode:x y @}} x+y+%40 [MW1.7+] Encodes variable values for use in external links. [3]
{{anchorencode:x #y @}} x_.23y_.40 [MW1.8+] Encodes variable values for use in external links. [4]
{{fullurl:x y @}}
{{fullurle:x y @}}
{{fullurl:m:a|b=c}}
http://apbwiki.rpipepbandalumni.org/X_y_@
http://apbwiki.rpipepbandalumni.org/X_y_@
http://apbwiki.rpipepbandalumni.org/index.php?title=M:a&b=c
[MW1.5+] Returns the full URL of a given page. Optional query parameter as for localurl:.

Formatting

Word Example Explanation
{{#language:}} {{#language:da}} = dansk [MW1.7+] Native name of language code.
{{lc:}} {{lc:AbC dEf}} = abc def [MW1.5+] LowerCase
{{lcfirst:}} {{lcfirst:Ab Cd}} = ab Cd [MW1.5+] LC first char.
{{uc:}} {{uc:aBc DeF}} = ABC DEF [MW1.5+] UpperCase
{{ucfirst:}} {{ucfirst:aB cD}} = AB cD [MW1.5+] UC first char.
{{formatnum:}} {{formatnum:-299792458.56789}} = -299,792,458.56789 [MW1.7+] Add decimal separators according to the wiki's default locale. Leading minus and plus are recognized.
{{padleft:}}
{{padright:}}
{{padleft:bcd|6|a}} = aaabcd
{{padright:bcd|6|a}} = bcdaaa
[MW1.8+] Pads a string with a character to the specified width.

Padding does not seem to work for characters with a multi-character code, such as &nbsp;, which would be useful with padleft for sorting tables with Javascript.

Template modifiers

Usage Explanation
{{:xyz}} A bare colon is not a template modifier, it's the prefix for the main namespace. Test e.g. article {{:UTC}} vs. template {{UTC}}.
Using this syntax you include the text of the main namespace article xyz in another article.
{{int:xyz}} Shorthand for {{MediaWiki:xyz}}, rendered as ⧼xyz⧽ if [[MediaWiki:xyz]] doesn't exist.
{{msg:xyz}} Try {{Template:xyz}} before magic word xyz, without this modifier it's the other way around. No additional effect if there is no template xyz.
{{msgnw:xyz}} The unevaluated wikitext is rendered. Look up msgnw.
{{raw:xyz}} [MW1.6+] Like {{msg:}} (unclear) [5]
{{subst:xyz}} In the wikitext, the tag is substituted by the content (single-level evaluation only).

Image modifiers

For details see w:en:Wikipedia:Extended image syntax.

These are image modifiers used in [[Image:title.ext|modifier|...|modifier]] links. Some are mutually exclusive, and then the last specified wins.

Size

The last unrecognized modifier is used as caption for framed images or together with thumbnails. It's also used as description alt=text.

Word Usage Explanation
framed
frame
enframed
[[Image:Mediawiki.png|framed]] Places an image in a frame with a description. Uses original size.
thumbnail
thumb
[[Image:Mediawiki.png|thumbnail]] Modifies image size, sets it to dependant on user's favourite thumbnail size in their preferences.
thumb=xyz [[Image:Mediawiki.png|thumb=Wiki.png]] Manualthumb: instead of displaying an automatically-sized thumbnail for Mediawiki.png, display the image Wiki.png.
width px [[Image:Mediawiki.png|40px]] Scales image to given width  in pixels

Position

The positions are mutually exclusive, the last specified wins. Template:- can stop floating. For inline images only modifier px (see above) is supported.

Word Usage Explanation
right [[Image:Mediawiki.png|right]] Modifies position, floats the image to the right.
left [[Image:Mediawiki.png|left]] Modifies position, floats the image to the left.
none [[Image:Mediawiki.png|none]] Explicitly states that the image should not float.
center
centre
[[Image:Mediawiki.png|center]] Modifies position, like none but centered.

Miscellany

Word Example Explanation
{{DISPLAYTITLE:xyz}} default disabled [MW 1.7+] Set the page's title [6], see AllowDisplayTitle.
{{DIRMARK}}
{{DIRECTIONMARK}}

[MW1.7+] u+200E left to right or u+200D right to left mark
{{CONTENTLANGUAGE}} en [MW1.7+] Default content LanguageCode
#redirect #REDIRECT [[target]]
at top of source page
Creates a redirect to another page.

Language-dependent word conversions

Word Example Explanation
{{ CURRENTMONTHNAMEGEN }} December Genitive form of month name used for Czech, Polish, Ukrainian[7]
{{grammar:case | word }} {{grammar:7sg|Wikipedie}}
on cs is Wikipedií.
Derived word forms in inflected languages like Czech [8]
{{plural:count |form1 |form2 }}
{{plural:count |1st | 2nd | 3rd }}
{{plural: 2 | is | are }}
outputs are
{{plural: 0 | this | these }}
outputs these
count 1 yields form1 (singular), plural transformations are used for languages like Russian [9] based on "count mod 10".

"Grammar" and "Plural" are language-dependent functions, defined in [10], [11], etc. (note that in PHP, the modulo operator is the percent sign).

"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.

"Plural" is a project-dependent switch function, e.g. giving the first text if count = 1, the second if count = 2,3, or 4, and else the third. See also mediazilla:5805 for the use of "plural" in system messages.

See also