Content deleted Content added
The editor1 (talk | contribs) mNo edit summary |
refresh m:Help:Magic words |
||
Line 1: | Line 1: | ||
{{H:h|editor toc}} |
{{H:h|editor toc}} |
||
This is an index of Magic words used in MediaWiki. |
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 == |
|||
== <nowiki>#redirect</nowiki> == |
|||
{| {{prettytable}} width="75%" |
|||
Indicates a [[Help:Redirect|redirect]] |
|||
! Word !! Explanation |
|||
|- |
|||
| <nowiki>__NOTOC__</nowiki> |
|||
| Hides ToC on the current page. |
|||
|- |
|||
|<nowiki>__FORCETOC__</nowiki> |
|||
| Forces the table of contents to appear. |
|||
|- |
|||
| <nowiki>__TOC__</nowiki> |
|||
| Places a ToC here (see also [[w:en:Wikipedia:Section#Compact_TOC|compact TOC]]). |
|||
|} |
|||
== Formatting == |
|||
== <nowiki>__NOTOC__</nowiki> == |
|||
{| {{prettytable}} width="75%" |
|||
Hides the table of contents. |
|||
! Word !! Explanation |
|||
|- |
|||
| <nowiki>__NOEDITSECTION__</nowiki> |
|||
| Hides the edit links beside headings. |
|||
|- |
|||
| <nowiki>__NOTITLECONVERT__</nowiki> |
|||
| Can also be spelled <nowiki>__NOTC__</nowiki>. Same as __NOCC__, but article title only. |
|||
|- |
|||
| <nowiki>__NOCONTENTCONVERT__</nowiki> |
|||
| Can also be spelled <nowiki>__NOCC__</nowiki>. Don't perform the content language (character and phase) conversion in article display; for example, Chinese zh with zh_cn, zh_tw, zh_sg, zh_hk. |
|||
|- |
|||
| <nowiki>__END__</nowiki> |
|||
| Allows for trailing whitespace to be deliberately included in the page save. |
|||
|- |
|||
| <nowiki>__START__</nowiki> |
|||
| This magic word has no effect but an ID in <tt>MagicWord.php</tt> (<code>MAG_START</code>). |
|||
|} |
|||
{| {{prettytable}} width="75%" |
|||
== <nowiki>__FORCETOC__</nowiki> == |
|||
! Word !! Example !! Explanation |
|||
Always show the table of contents. |
|||
|- |
|||
| <nowiki>{{LC:}}</nowiki> |
|||
| <nowiki>{{LC:AbCdEf}}</nowiki> = {{LC:AbCdEf}} |
|||
| '''[MW1.5+]''' lowercase |
|||
|- |
|||
| <nowiki>{{UC:}}</nowiki> |
|||
| <nowiki>{{UC:AbCdEf}}</nowiki> = {{UC:AbCdEf}} |
|||
| '''[MW1.5+]''' UpperCase |
|||
|- |
|||
| <nowiki>{{LCFIRST}}</nowiki> |
|||
| <nowiki>{{LCFIRST:AbCdEf}}</nowiki> = {{LCFIRST:AbCdEf}} |
|||
| '''[MW1.5+]''' LC first character |
|||
|- |
|||
| <nowiki>{{UCFIRST}}</nowiki> |
|||
| <nowiki>{{UCFIRST:abCdEf}}</nowiki> = {{UCFIRST:abCdEf}} |
|||
| '''[MW1.5+]''' UC first character |
|||
|} |
|||
== Template modifiers == |
|||
== <nowiki>__TOC__</nowiki> == |
|||
{| {{prettytable}} width="75%" |
|||
Place the table of contents here. See also [[w:en:Wikipedia:Section#Compact_TOC|compact TOC]] |
|||
! Word !! Usage !! Explanation |
|||
|- |
|||
| <nowiki>subst:</nowiki> |
|||
| <nowiki>{{subst:XYZ}}</nowiki> |
|||
| Substitutes the template call with the ''content'' of the template. |
|||
|- |
|||
| <nowiki>msg:</nowiki> |
|||
| ''n/a''. |
|||
| If a template clashes with a magic word, use of the msg: modifier will use the template instead of the magic word. Otherwise, the magic word is used. |
|||
|- |
|||
| <nowiki>msgnw:</nowiki> |
|||
| <nowiki>{{msgnw:XYZ}}</nowiki> |
|||
| A template modifier. Causes the template code to be pasted in plaintext format. |
|||
|- |
|||
| <nowiki>INT:</nowiki> |
|||
| ''n/a'' |
|||
| Used for MediaWiki messages, equivalent to "MediaWiki:". If a template clashes with MediaWiki message, use of the INT: modifier will use the message. Otherwise, the template is used. |
|||
|}{{-}} |
|||
== Time == |
|||
== <nowiki>__NOEDITSECTION__</nowiki> == |
|||
{| {{prettytable}} |
|||
Hide the edit links. |
|||
! Word !! Example !! Explanation |
|||
|- |
|||
| <nowiki>{{CURRENTDAY}}</nowiki> |
|||
| {{CURRENTDAY}} |
|||
| Displays the current day in numeric form. |
|||
|- |
|||
| <nowiki>{{CURRENTDAYNAME}}</nowiki> |
|||
| {{CURRENTDAYNAME}} |
|||
| Displays the current day in named form. |
|||
|- |
|||
| <nowiki>{{CURRENTDOW}}</nowiki> |
|||
| {{CURRENTDOW}} |
|||
| Displays the current day as a number of the week (0=Sunday, 1=Monday...). |
|||
|- |
|||
|<nowiki>{{CURRENTMONTH}}</nowiki> |
|||
| {{CURRENTMONTH}} |
|||
| Displays the current month in numeric form. |
|||
|- |
|||
| <nowiki>{{CURRENTMONTHABBREV}}</nowiki> |
|||
| {{CURRENTMONTHABBREV}} |
|||
| '''[MW1.5+]''' Displays the abbreviation of the current month. |
|||
|- |
|||
|<nowiki>{{CURRENTMONTHNAME}}</nowiki> |
|||
| {{CURRENTMONTHNAME}} |
|||
| Displays the current month in named form. |
|||
|- |
|||
| <nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki> |
|||
| {{CURRENTMONTHNAMEGEN}} |
|||
| Displays the name of the current month in [[w:genitive form|genitive form]]. Wikis that don't support this will default to <nowiki>{{CURRENTMONTHNAME}}</nowiki>. |
|||
|- |
|||
| <nowiki>{{CURRENTTIME}}</nowiki> |
|||
| {{CURRENTTIME}} |
|||
| Displays the current time of day (hours:minutes). |
|||
|- |
|||
| <nowiki>{{CURRENTWEEK}}</nowiki> |
|||
| {{CURRENTWEEK}} |
|||
| Displays the number of the current week (1-52). |
|||
|- |
|||
| <nowiki>{{CURRENTYEAR}}</nowiki> |
|||
| {{CURRENTYEAR}} |
|||
| Returns the current year. |
|||
|} |
|||
== Page names, locations, and URLs == |
|||
== <nowiki>__START__</nowiki> == |
|||
{| {{prettytable}} |
|||
<nowiki>__START__</nowiki> does nothing, and it is considered a magic word only because it has an ID in <tt>MagicWord.php</tt> (<code>MAG_START</code>). |
|||
! Word !! Example !! Explanation |
|||
|- |
|||
| <nowiki>{{PAGENAME}}</nowiki> |
|||
| {{PAGENAME}} |
|||
| Returns the name of the current page, including all levels (Title/Subtitle/Sub-subtitle). |
|||
|- |
|||
| <nowiki>{{PAGENAMEE}}</nowiki> |
|||
| {{PAGENAMEE}} |
|||
| URL-friendly with percent encoded special characters (see [[w:ASCII|US-ASCII]]). |
|||
|- |
|||
| <nowiki>{{SUBPAGENAME}}</nowiki> |
|||
| {{SUBPAGENAME}} |
|||
| '''[MW1.5+]''' Returns the name of the current page, excluding parent pages ("Title/Subtitle" becomes "Subtitle"). |
|||
|- |
|||
| <nowiki>{{NAMESPACE}}</nowiki><br /><nowiki>{{NAMESPACEE}}</nowiki> |
|||
| {{NAMESPACE}}<br />{{NAMESPACEE}} |
|||
| Returns the name of the namespace the current page resides in. |
|||
|- |
|||
| <nowiki>{{FULLPAGENAME}}</nowiki><br ><nowiki>{{FULLPAGENAMEE}}</nowiki> |
|||
| {{FULLPAGENAME}}<br />{{FULLPAGENAMEE}} |
|||
| Shorthand <nowiki>{{NAMESPACE}}:{{PAGENAME}}</nowiki><br />or <nowiki>{{NAMESPACEE}}:{{PAGENAMEE}}</nowiki> resp. |
|||
|- |
|||
| <nowiki>{{REVISIONID}}</nowiki> |
|||
| {{REVISIONID}} |
|||
| '''[MW1.5+]''' Gives you the unique identifying number of the article or diff database. |
|||
|- |
|||
| <nowiki>{{SITENAME}}</nowiki> |
|||
| {{SITENAME}} |
|||
| Returns the name of the wiki (set in <tt>LocalSettings.php</tt>). |
|||
|- |
|||
| <nowiki>{{NS:}}</nowiki> |
|||
| <code><nowiki>{{NS:4}}</nowiki></code> = {{NS:4}}<br /><code><nowiki>{{NS:PROJECT}}</nowiki></code> = {{NS:PROJECT}} |
|||
| Returns the name of a given [[Help:Namespace|namespace number]]. |
|||
|- |
|||
| <nowiki>{{LOCALURL:XYZ}}</nowiki><br /><nowiki>{{LOCALURLE:!}}</nowiki> |
|||
| {{localurl:XYZ}}<br />{{localurle:!}} |
|||
| Returns the local URL of a given page. The page might not exist. |
|||
|- |
|||
| <nowiki>{{SERVER}}</nowiki> |
|||
| {{SERVER}} |
|||
| Returns the domain and subdomain URL of the wiki. In conjunction with <nowiki>{{localurl:}}</nowiki> obsolete, use <nowiki>{{fullurl:}}</nowiki> |
|||
|- |
|||
| <nowiki>{{FULLURL:XYZ}}</nowiki><br /><nowiki>{{FULLURLE:!}}</nowiki> |
|||
| {{fullurl:XYZ}}<br />{{fullurle:!}} |
|||
| '''[MW1.5+]''' Returns the full URL of a given page. |
|||
|- |
|||
| <nowiki>{{SCRIPTPATH}}</nowiki> |
|||
| {{SCRIPTPATH}} |
|||
| '''[MW1.5+]''' Returns the value of $wgScriptPath in <tt>LocalSettings.php</tt>. |
|||
|- |
|||
| <nowiki>{{SERVERNAME}}</nowiki> |
|||
| {{SERVERNAME}} |
|||
| '''[MW1.5+]''' Returns the value of $wgServerName in <tt>LocalSettings.php</tt>. |
|||
|} |
|||
== <nowiki>CURRENTMONTH</nowiki> == |
|||
A [[Help:Variable|variable]]. |
|||
{{CURRENTMONTH}} |
|||
== Image Modifiers == |
|||
== <nowiki>CURRENTMONTHNAME</nowiki> == |
|||
These are [[Help:Image|image]] modifiers used in an image tag (<code><nowiki>[[Image:title.ext|modifier|...|modifier]]</nowiki></code>). Some are mutually exclusive, and then the last specified wins. |
|||
A [[Help:Variable|variable]]. |
|||
=== Size === |
|||
{{CURRENTMONTHNAME}} |
|||
The last unrecognized modifier is used as '''caption''' for ''framed'' images or together with ''thumbnail''s. It's also used as description <tt>alt=</tt>''text''. |
|||
== <nowiki>CURRENTDAY</nowiki> == |
|||
A [[Help:Variable|variable]]. |
|||
{{ |
{| {{prettytable}} |
||
! Word !! Usage !! Explanation |
|||
|- |
|||
| framed |
|||
| <nowiki>[[Image:Mediawiki.png|framed]]</nowiki> |
|||
| Places an image in a ''frame'' with a description. Can also be spelled ''enframed'' or ''frame''. Uses original size. |
|||
|- |
|||
| thumbnail |
|||
| <nowiki>[[Image:Mediawiki.png|thumbnail]]</nowiki> |
|||
| Modifies image size, sets it to dependant on user's favourite thumbnail size in their preferences. Can also be used as ''thumb''. |
|||
|- |
|||
| ''width'' px |
|||
| <nowiki>[[Image:Mediawiki.png|40px]]</nowiki> |
|||
| Scales image to given ''width''  in pixels |
|||
|- |
|||
| ''width'' x''height'' px |
|||
| <nowiki>[[Image:Mediawiki.png|40x80px]]</nowiki> |
|||
| Stretches image to ''width'' '''x'''''height'' |
|||
|} |
|||
=== Position === |
|||
== <nowiki>CURRENTDAYNAME</nowiki> == |
|||
The positions are mutually exclusive, the last specified wins. [[:Template:clr]] can stop floating. For inline images only modifier ''px'' (see above) is supported. |
|||
A [[Help:Variable|variable]]. |
|||
{| {{prettytable}} |
|||
! Word !! Usage !! Explanation |
|||
|- |
|||
| right |
|||
| <nowiki>[[Image:Mediawiki.png|right]]</nowiki> |
|||
| Modifies position, floats the image to the right. |
|||
|- |
|||
| <nowiki>left</nowiki> |
|||
| <nowiki>[[Image:Mediawiki.png|left]]</nowiki> |
|||
| Modifies position, floats the image to the left. |
|||
|- |
|||
| <nowiki>none</nowiki> |
|||
| <nowiki>[[Image:Mediawiki.png|none]]</nowiki> |
|||
| Modifies position, explicitly states image should not float. |
|||
|- |
|||
| center |
|||
| <nowiki>[[Image:Mediawiki.png|center]]</nowiki> |
|||
| Like ''none'' but centered. Can also be spelled ''centre''. |
|||
|} |
|||
== Miscellany == |
|||
{{CURRENTDAYNAME}} |
|||
{| {{prettytable}} |
|||
! Word !! Usage !! Explanation |
|||
|- |
|||
| <nowiki>{{NUMBEROFARTICLES}}</nowiki> |
|||
| {{NUMBEROFARTICLES}} |
|||
| A [[Help:Variable|variable]]. |
|||
|- |
|||
| <nowiki>{{NUMBEROFFILES}}</nowiki> |
|||
| {{NUMBEROFFILES}} |
|||
| '''[MW1.5+]''' Returns the number of uploaded files (rows in the image table). |
|||
|- |
|||
| <nowiki>{{raw:}}</nowiki> |
|||
| <nowiki>{{raw:fullpagename}}</nowiki> |
|||
| Inserts raw content, ''raw:Mediawiki:'' works like ''INT:'', see [[#Template_modifiers|above]] |
|||
|- |
|||
| <nowiki>{{grammar:}}</nowiki> |
|||
| <nowiki>{{grammar:7sg|Wikipedie}}</nowiki> outputs Wikipedií. |
|||
| Returns derived word forms in inflected languages. Usage is <nowiki>{{grammar:case|word}}</nowiki>. Cases in which this could be used depend on the specific language. |
|||
|- |
|||
| <nowiki>#redirect</nowiki> |
|||
| <code>#REDIRECT <nowiki>[[Help:Redirect]]</nowiki></code><br />at top of [[Help:Redirection]] |
|||
| Creates a [[Help:Redirect|redirect]] to another page. |
|||
|} |
|||
''Probably incomplete, wasn't there something like <nowiki>{{plurals}}</nowiki> (?)'' |
|||
A [[Help:Variable|variable]]. |
|||
==See also== |
|||
{{CURRENTYEAR}} |
|||
*[[Help:Variable]] |
|||
*[[Help:Colon function]] |
|||
<br /> |
|||
== <nowiki>CURRENTTIME</nowiki> == |
|||
{{H:f|langs=|enname=Magic words}} |
|||
A [[Help:Variable|variable]]. |
|||
{{CURRENTTIME}} |
|||
== <nowiki>NUMBEROFARTICLES</nowiki> == |
|||
A [[Help:Variable|variable]]. |
|||
{{NUMBEROFARTICLES}} |
|||
----{{btot}}---- |
|||
== <nowiki>CURRENTMONTHNAMEGEN</nowiki> == |
|||
A [[Help:Variable|variable]]. |
|||
{{CURRENTMONTHNAMEGEN}} |
|||
== <nowiki>PAGENAME</nowiki> == |
|||
A [[Help:Variable|variable]]. |
|||
{{PAGENAME}} |
|||
== <nowiki>PAGENAMEE</nowiki> == |
|||
A [[Help:Variable|variable]]. |
|||
{{PAGENAMEE}} |
|||
== <nowiki>NAMESPACE</nowiki> == |
|||
A [[Help:Variable|variable]]. |
|||
{{NAMESPACE}} |
|||
== <nowiki>MSG:</nowiki> == |
|||
A [[Help:Template|template]] modifier, i.e. <nowiki>{{msg:stub}}</nowiki> shows |
|||
<nowiki>{{Stub}}</nowiki> |
|||
---- |
|||
The use of msg has an effect when a template name clashes with a magic word. For example, if <nowiki>[[Template:CURRENTMONTHNAME]]</nowiki> contained "Test", then <nowiki>{{CURRENTMONTHNAME}}</nowiki> would display "{{CURRENTMONTHNAME}}" but <nowiki>{{msg:CURRENTMONTHNAME}}</nowiki> would display "Test". |
|||
== <nowiki>SUBST:</nowiki> == |
|||
A template modifier. Replaces the <i>reference</i> to the template (e.g. <nowiki>{{subst:template}}</nowiki>) with the <i>content</i> of the template. |
|||
e.g. <nowiki>{{subst:stub}}</nowiki> copies the <nowiki>{{stub}}</nowiki> contents below to the article, without using the template. |
|||
''This article is a [http://en.wikipedia.org/wiki/Wikipedia:Stub stub]. You can [http://en.wikipedia.org/wiki/Wikipedia:Find_or_fix_a_stub help] Wikimedia by [http://en.wikipedia.org/w/wiki.phtml?title=Template:Stub&action=edit expanding it].'' |
|||
SUBST: can be helpful to avoid the overuse of meta-templates. |
|||
== <nowiki>MSGNW:</nowiki> == |
|||
A template modifier. Causes the template source to be pasted. |
|||
So <nowiki><pre>{{msgnw:stub}}</pre></nowiki> outputs: |
|||
---- |
|||
<nowiki>{{msgnw:stub}}</nowiki> |
|||
---- |
|||
== <nowiki>__END__</nowiki> == |
|||
Allows for trailing whitespace to be deliberately included in the page save. |
|||
== <nowiki>thumbnail</nowiki> == |
|||
An [[Help:Image|image]] modifier. 'Thumb' has the same effect. |
|||
[[Image:Mediawiki.png|thumbnail|Mediawiki]]{{clear}} |
|||
== <nowiki>right</nowiki> == |
|||
An image modifier. |
|||
[[Image:Mediawiki.png|right|Mediawiki]]{{clear}} |
|||
== <nowiki>left</nowiki> == |
|||
An image modifier. |
|||
[[Image:Mediawiki.png|left|Mediawiki]]{{clear}} |
|||
== <nowiki>none</nowiki> == |
|||
An image modifier. |
|||
[[Image:Mediawiki.png|none|Mediawiki]]{{clear}} |
|||
== <nowiki>$1px</nowiki> == |
|||
An image modifier. |
|||
[[Image:Mediawiki.png|142px|Mediawiki]]{{clear}} |
|||
== <nowiki>center</nowiki> == |
|||
An image modifier. Can also be spelled <nowiki>centre</nowiki>. |
|||
[[Image:Mediawiki.png|center|Mediawiki]]{{clear}} |
|||
== <nowiki>framed</nowiki> == |
|||
An image modifier. Can also be spelled <nowiki>enframed</nowiki> or <nowiki>frame</nowiki>. |
|||
[[Image:Mediawiki.png|framed|Mediawiki]]{{clear}} |
|||
----{{btot}}---- |
|||
== <nowiki>INT:</nowiki> == |
|||
A special [[Help:Template|template]]. Used for UI messages. |
|||
<code>mainpage</code>:<br /> |
|||
{{INT:mainpage}} |
|||
== <nowiki>SITENAME</nowiki> == |
|||
A [[Help:Variable|variable]]. |
|||
{{SITENAME}} |
|||
== <nowiki>NS:</nowiki> == |
|||
A special [[Help:Template|template]]. Gets the name of a given namespace number. |
|||
<code>4</code>:<br /> |
|||
{{NS:4}} |
|||
== <nowiki>LOCALURL:</nowiki> == |
|||
A special [[Help:Template|template]]. Gets the local URL of the given page. |
|||
<pre>{{localurl:Help:Magic words|section=0}}</pre> |
|||
yields |
|||
{{localurl:Help:Magic words|section=0}} |
|||
== <nowiki>LOCALURLE:</nowiki> == |
|||
A special [[Help:Template|template]]. Gets the local URL of the given page. |
|||
<pre>{{localurle:Help:Magic words|section=0}}</pre> |
|||
yields |
|||
{{localurle:Help:Magic words|section=0}} |
|||
== <nowiki>SERVER</nowiki> == |
|||
A [[Help:Variable|variable]]. |
|||
<nowiki>{{SERVER}}</nowiki> produces |
|||
{{SERVER}} |
|||
== <nowiki>GRAMMAR:</nowiki> == |
|||
Useful for inflected languages to derive word forms. Usage: <nowiki>{{grammar:case|word}}</nowiki>, cases in which this could be used depend on the specific language. |
|||
E. g. in Czech language, <nowiki>{{grammar:1sg|Wikipedie}}</nowiki> outputs ''Wikipedie'', while <nowiki>{{grammar:7sg|Wikipedie}}</nowiki> outputs Wikipedií. |
|||
== <nowiki>__NOTITLECONVERT__</nowiki> == |
|||
? Can also be spelled <nowiki>__NOTC__</nowiki>. |
|||
Same as below __NOCC__ but Article Title only. |
|||
== <nowiki>__NOCONTENTCONVERT__</nowiki> == |
|||
? Can also be spelled <nowiki>__NOCC__</nowiki>. |
|||
Don't perform the content language(character & phase) conversion in article display.(eg, Chinese zh with zh_cn, zh_tw, zh_sg, zh_hk) |
|||
== <nowiki>CURRENTWEEK</nowiki> == |
|||
A [[Help:Variable|variable]], returning the number of the current week (1-52). |
|||
{{CURRENTWEEK}} |
|||
== <nowiki>CURRENTDOW</nowiki> == |
|||
A [[Help:Variable|variable]], returning the number of the current day of the week (0=Sunday, 1=Monday). |
|||
{{CURRENTDOW}} |
|||
=Since v1.5= |
|||
==CURRENTMONTHABBREV== |
|||
A [[Help:Variable|variable]] that returns the abbreviation of the current month. |
|||
{{CURRENTMONTHABBREV}} |
|||
==FULLURL:, FULLURLE:== |
|||
Special [[Help:Template|template]]s that give the full URL of the given page. |
|||
{{FULLURL:page}} |
|||
==REVISIONID== |
|||
Gives you the article or diff database |
|||
{{REVISIONID}} |
|||
==SCRIPTPATH== |
|||
Returns $wgScriptPath |
|||
{{SCRIPTPATH}} |
|||
==SERVERNAME== |
|||
Returns $wgServerName |
|||
{{SERVERNAME}} |
|||
==NUMBEROFFILES== |
|||
Returns the number of uploaded files (rows in the image table). |
|||
{{NUMBEROFFILES}} |
|||
{{H:f|langs=|enname=Magic words}}{{btot}} |
Revision as of 07:08, 27 March 2006
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
Word | Explanation |
---|---|
__NOTOC__ | Hides ToC on the current page. |
__FORCETOC__ | Forces the table of contents to appear. |
__TOC__ | Places a ToC here (see also compact TOC). |
Formatting
Word | Explanation |
---|---|
__NOEDITSECTION__ | Hides the edit links beside headings. |
__NOTITLECONVERT__ | Can also be spelled __NOTC__. Same as , but article title only. |
__NOCONTENTCONVERT__ | Can also be spelled __NOCC__. Don't perform the content language (character and phase) conversion in article display; for example, Chinese zh with zh_cn, zh_tw, zh_sg, zh_hk. |
__END__ | Allows for trailing whitespace to be deliberately included in the page save. |
__START__ | This magic word has no effect but an ID in MagicWord.php (MAG_START ).
|
Word | Example | Explanation |
---|---|---|
{{LC:}} | {{LC:AbCdEf}} = abcdef | [MW1.5+] lowercase |
{{UC:}} | {{UC:AbCdEf}} = ABCDEF | [MW1.5+] UpperCase |
{{LCFIRST}} | {{LCFIRST:AbCdEf}} = abCdEf | [MW1.5+] LC first character |
{{UCFIRST}} | {{UCFIRST:abCdEf}} = AbCdEf | [MW1.5+] UC first character |
Template modifiers
Word | Usage | Explanation |
---|---|---|
subst: | {{subst:XYZ}} | Substitutes the template call with the content of the template. |
msg: | n/a. | If a template clashes with a magic word, use of the msg: modifier will use the template instead of the magic word. Otherwise, the magic word is used. |
msgnw: | {{msgnw:XYZ}} | A template modifier. Causes the template code to be pasted in plaintext format. |
INT: | n/a | Used for MediaWiki messages, equivalent to "MediaWiki:". If a template clashes with MediaWiki message, use of the INT: modifier will use the message. Otherwise, the template is used. |
Time
Word | Example | Explanation |
---|---|---|
{{CURRENTDAY}} | 1 | Displays the current day in numeric form. |
{{CURRENTDAYNAME}} | Saturday | Displays the current day in named form. |
{{CURRENTDOW}} | 6 | Displays the current day as a number of the week (0=Sunday, 1=Monday...). |
{{CURRENTMONTH}} | 06 | Displays the current month in numeric form. |
{{CURRENTMONTHABBREV}} | Jun | [MW1.5+] Displays the abbreviation of the current month. |
{{CURRENTMONTHNAME}} | June | Displays the current month in named form. |
{{CURRENTMONTHNAMEGEN}} | June | Displays the name of the current month in genitive form. Wikis that don't support this will default to {{CURRENTMONTHNAME}}. |
{{CURRENTTIME}} | 12:11 | Displays the current time of day (hours:minutes). |
{{CURRENTWEEK}} | 22 | Displays the number of the current week (1-52). |
{{CURRENTYEAR}} | 2024 | Returns the current year. |
Page names, locations, and URLs
Word | Example | Explanation |
---|---|---|
{{PAGENAME}} | Magic words | Returns the name of the current page, including all levels (Title/Subtitle/Sub-subtitle). |
{{PAGENAMEE}} | Magic_words | URL-friendly with percent encoded special characters (see US-ASCII). |
{{SUBPAGENAME}} | Magic words | [MW1.5+] Returns the name of the current page, excluding parent pages ("Title/Subtitle" becomes "Subtitle"). |
{{NAMESPACE}} {{NAMESPACEE}} |
Help Help |
Returns the name of the namespace the current page resides in. |
{{FULLPAGENAME}} {{FULLPAGENAMEE}} |
Help:Magic words Help:Magic_words |
Shorthand {{NAMESPACE}}:{{PAGENAME}} or {{NAMESPACEE}}:{{PAGENAMEE}} resp. |
{{REVISIONID}} | - | [MW1.5+] Gives you the unique identifying number of the article or diff database. |
{{SITENAME}} | Wikipedia | Returns the name of the wiki (set in LocalSettings.php). |
{{NS:}} | {{NS:4}} = Wikipedia{{NS:PROJECT}} = Wikipedia
|
Returns the name of a given namespace number. |
{{LOCALURL:XYZ}} {{LOCALURLE:!}} |
/wiki/XYZ /wiki/! |
Returns the local URL of a given page. The page might not exist. |
{{SERVER}} | //en.wikipedia.org | Returns the domain and subdomain URL of the wiki. In conjunction with {{localurl:}} obsolete, use {{fullurl:}} |
{{FULLURL:XYZ}} {{FULLURLE:!}} |
//en.wikipedia.org/wiki/XYZ //en.wikipedia.org/wiki/! |
[MW1.5+] Returns the full URL of a given page. |
{{SCRIPTPATH}} | /w | [MW1.5+] Returns the value of $wgScriptPath in LocalSettings.php. |
{{SERVERNAME}} | en.wikipedia.org | [MW1.5+] Returns the value of $wgServerName in LocalSettings.php. |
Image Modifiers
These are image modifiers used in an image tag ([[Image:title.ext|modifier|...|modifier]]
). 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 | [[Image:Mediawiki.png|framed]] | Places an image in a frame with a description. Can also be spelled enframed or frame. Uses original size. |
thumbnail | [[Image:Mediawiki.png|thumbnail]] | Modifies image size, sets it to dependant on user's favourite thumbnail size in their preferences. Can also be used as thumb. |
width px | [[Image:Mediawiki.png|40px]] | Scales image to given width in pixels |
width xheight px | [[Image:Mediawiki.png|40x80px]] | Stretches image to width xheight |
Position
The positions are mutually exclusive, the last specified wins. Template:clr 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]] | Modifies position, explicitly states image should not float. |
center | [[Image:Mediawiki.png|center]] | Like none but centered. Can also be spelled centre. |
Miscellany
Word | Usage | Explanation |
---|---|---|
{{NUMBEROFARTICLES}} | 6,829,976 | A variable. |
{{NUMBEROFFILES}} | 918,070 | [MW1.5+] Returns the number of uploaded files (rows in the image table). |
{{raw:}} | {{raw:fullpagename}} | Inserts raw content, raw:Mediawiki: works like INT:, see above |
{{grammar:}} | {{grammar:7sg|Wikipedie}} outputs Wikipedií. | Returns derived word forms in inflected languages. Usage is {{grammar:case|word}}. Cases in which this could be used depend on the specific language. |
#redirect | #REDIRECT [[Help:Redirect]] at top of Help:Redirection |
Creates a redirect to another page. |
Probably incomplete, wasn't there something like {{plurals}} (?)