Changes

MyWikiBiz, Author Your Legacy — Thursday November 21, 2024
Jump to navigationJump to search
2,093 bytes added ,  11:38, 6 June 2007
no edit summary
Line 1: Line 1:  
{{Help contents back}}
 
{{Help contents back}}
 
----
 
----
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.
+
This is an organized index of Magic words used in MediaWiki.
   −
== Table of contents ==
+
A "'''[[Magic (programming)|magic]] word'''" is a symbol which is 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.  A magic word can be:
 +
*an upper case word, preceded and followed by two underscores, e.g. '''<nowiki>__NOTOC__</nowiki>'''
 +
*an 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 version that first supported the magic word. "XYZ" indicates user input, which is used in the example.
 +
 
 +
==Magic words between double underscores==
 +
=== Table of contents ===
 
:''For details see [[Help:Section]]''  
 
:''For details see [[Help:Section]]''  
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" width="79%"
+
<br clear="left" />
! 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 (overriding any <nowiki>__NOTOC__</nowiki>).
  −
|}<br clear="left" />
     −
=== More magic ===
+
=== Other ===
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" width="79%"
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0" width="79%"
 
! Word  
 
! Word  
Line 40: Line 41:  
|-
 
|-
 
| <nowiki>__END__</nowiki>
 
| <nowiki>__END__</nowiki>
| Allows for trailing whitespace to be included in the page save.
+
| Allows for trailing whitespace to be included in the page save (does not seem to work anymore).
 
|-
 
|-
 
| <nowiki>__START__</nowiki>
 
| <nowiki>__START__</nowiki>
 
| This magic word has no effect but an ID in <tt>MagicWord.php</tt> (<code>MAG_START</code>).
 
| This magic word has no effect but an ID in <tt>MagicWord.php</tt> (<code>MAG_START</code>).
 
|}<br clear="left" />
 
|}<br clear="left" />
 +
 +
==XML-style tags==
 +
'''nowiki''': &lt;nowiki>'''...'''&lt;/nowiki>, disables expansion/interpretation of templates, link syntax, formatting syntax, etc.: <nowiki>&lt;nowiki>'''[[{{tc}}]]'''&lt;/nowiki></nowiki> gives <nowiki>'''[[{{tc}}]]'''</nowiki>
 +
'''pre''': &lt;pre>'''...'''&lt;/pre>, ditto, also for multiple lines; it is rendered with a new paragraph at the start and end: a&lt;pre><nowiki>'''[[{{tc}}]]'''</nowiki>&lt;/pre>b gives a<pre>'''[[{{tc}}]]'''</pre>b
 +
'''math''': &lt;math>'''...'''&lt;/math>, e.g. <nowiki><math>\alpha^2+\beta^2=1</math></nowiki> gives <math>\alpha^2+\beta^2=1</math>; see [[Help:Displaying a formula]]
 +
'''hiero''': &lt;hiero>'''...'''&lt;/hiero>, e.g. <nowiki><hiero>A1</hiero></nowiki> gives: <hiero>A1</hiero>
 +
 +
See also: [[Extending wiki markup]].
    
== Variables ==
 
== Variables ==
Line 50: Line 59:     
===Time===  
 
===Time===  
The time in [[:en:UTC|UTC]].
+
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"  
 
{| class="wikitable sortable" border="2" cellpadding="4" cellspacing="0"  
 
! Word  
 
! Word  
Line 78: Line 87:  
| <nowiki>{{CURRENTMONTHABBREV}}</nowiki>
 
| <nowiki>{{CURRENTMONTHABBREV}}</nowiki>
 
| <code>{{CURRENTMONTHABBREV}}</code>
 
| <code>{{CURRENTMONTHABBREV}}</code>
| '''[MW1.5+]''' Same as <nowiki>{{CURRENTMONTH}}</nowiki>, but in abbreviated form as Jan .. Dec.
+
| '''[MW1.5+]''' Same as <nowiki>{{CURRENTMONTH}}</nowiki>, but in abbreviated form (Jan .. Dec).
 
|-
 
|-
 
| <nowiki>{{CURRENTMONTHNAME}}</nowiki>
 
| <nowiki>{{CURRENTMONTHNAME}}</nowiki>
 
| <code>{{CURRENTMONTHNAME}}</code>
 
| <code>{{CURRENTMONTHNAME}}</code>
| Same as <nowiki>{{CURRENTMONTH}}</nowiki>, but in named form January .. December.
+
| Same as <nowiki>{{CURRENTMONTH}}</nowiki>, but in named form (January .. December).
 
|-
 
|-
 
| <nowiki>{{CURRENTTIME}}</nowiki>
 
| <nowiki>{{CURRENTTIME}}</nowiki>
Line 106: Line 115:     
===Local time===  
 
===Local time===  
The time depending on the local timezone of the wiki. (All words '''[MW1.8+]''' )
+
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+]''' )
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"  
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"  
 
! Word  
 
! Word  
Line 164: Line 173:     
=== Statistics ===
 
=== Statistics ===
 +
Statistics variables give thousands separators unless ":R" for "raw" is added (actually, these versions are parser functions).
 +
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"  
 
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"  
 
! Word  
 
! Word  
Line 172: Line 183:  
| <code>{{CURRENTVERSION}}</code>
 
| <code>{{CURRENTVERSION}}</code>
 
| '''[MW1.7+]''' {{h:mwg|Version}} [http://mail.wikipedia.org/pipermail/mediawiki-i18n/2006-May/000026.html]
 
| '''[MW1.7+]''' {{h:mwg|Version}} [http://mail.wikipedia.org/pipermail/mediawiki-i18n/2006-May/000026.html]
 +
|-
 +
|<nowiki>{{NUMBEROFEDITS}}</nowiki><br /><nowiki>{{NUMBEROFEDITS:R}}</nowiki>
 +
| <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>
 
| <nowiki>{{NUMBEROFARTICLES}}</nowiki><br /><nowiki>{{NUMBEROFARTICLES:R}}</nowiki>
Line 203: Line 218:     
=== Page names and related info ===
 
=== Page names and related info ===
{| class="wikitable" border="2" cellpadding="4" cellspacing="0"
+
{{:H:Page_name_variables}}
! Word
  −
! Example
  −
! Explanation
  −
|-
  −
| <nowiki>{{PAGENAME}}</nowiki>
  −
| <code>{{PAGENAME}}</code>
  −
| Returns the name of the current page, including all levels (Title/Subtitle).
  −
|-
  −
| <nowiki>{{PAGENAMEE}}</nowiki>
  −
| <code>{{PAGENAMEE}}</code>
  −
| More URL-friendly percent encoded special characters (To use an articlename in an external link).
  −
|-
  −
| <nowiki>{{SUBPAGENAME}}</nowiki><br /><nowiki>{{SUBPAGENAMEE}}</nowiki>
  −
| <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]].
  −
|-
  −
| <nowiki>{{BASEPAGENAME}}</nowiki><br ><nowiki>{{BASEPAGENAMEE}}</nowiki>
  −
| <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]].
  −
|-
  −
| <nowiki>{{NAMESPACE}}</nowiki><br /><nowiki>{{NAMESPACEE}}</nowiki>
  −
| <code>{{NAMESPACE}}<br />{{NAMESPACEE}}</code>
  −
| Returns the name of the namespace the current page resides in.
  −
|-
  −
| <nowiki>{{FULLPAGENAME}}</nowiki><br ><nowiki>{{FULLPAGENAMEE}}</nowiki>
  −
| <code>{{FULLPAGENAME}}<br />{{FULLPAGENAMEE}}</code>
  −
| '''[MW1.6+]''' Shorthands for NAMESPACE+PAGENAME
  −
|-
  −
| <nowiki>{{TALKSPACE}}</nowiki><br ><nowiki>{{TALKSPACEE}}</nowiki>
  −
| <code>{{TALKSPACE}}<br />{{TALKSPACEE}}</code>
  −
| '''[MW1.7+]''' Name of next odd namespace (e.g. 4 =&gt; 5) 
  −
|-
  −
| <nowiki>{{SUBJECTSPACE}}</nowiki><br ><nowiki>{{SUBJECTSPACEE}}</nowiki>
  −
| <code>{{SUBJECTSPACE}}<br />{{SUBJECTSPACEE}}</code>
  −
| '''[MW1.7+]''' Name of last even namespace (e.g. 5 =&gt; 4)
  −
|-
  −
| <nowiki>{{ARTICLESPACE}}</nowiki><br ><nowiki>{{ARTICLESPACEE}}</nowiki>
  −
| <code>{{ARTICLESPACE}}<br />{{ARTICLESPACEE}}</code>
  −
| '''[MW1.7+]''' An alias for SUBJECTSPACE(E)
  −
|-
  −
| <nowiki>{{TALKPAGENAME}}</nowiki><br ><nowiki>{{TALKPAGENAMEE}}</nowiki>
  −
| <code>{{TALKPAGENAME}}<br />{{TALKPAGENAMEE}}</code>
  −
| '''[MW1.7+]''' FULLPAGENAME in its TALKSPACE
  −
|-
  −
| <nowiki>{{SUBJECTPAGENAME}}</nowiki><br ><nowiki>{{SUBJECTPAGENAMEE}}</nowiki>
  −
| <code>{{SUBJECTPAGENAME}}<br />{{SUBJECTPAGENAMEE}}</code>
  −
| '''[MW1.7+]''' FULLPAGENAME in its SUBJECTSPACE
  −
|-
  −
| <nowiki>{{ARTICLEPAGENAME}}</nowiki><br ><nowiki>{{ARTICLEPAGENAMEE}}</nowiki>
  −
| <code>{{ARTICLEPAGENAME}}<br />{{ARTICLEPAGENAMEE}}</code>
  −
| '''[MW1.7+]''' An alias for SUBJECTPAGENAME(E)
  −
|-
  −
| <nowiki>{{REVISIONID}}</nowiki>
  −
| <code>{{REVISIONID}}</code>
  −
| '''[MW1.5+]''' The unique identifying number of a page, see [[Help:Diff]].
  −
|-
  −
| <nowiki>{{REVISIONDAY}}</nowiki>
  −
| <code>{{REVISIONDAY}}</code>
  −
| '''[MW1.8+]''' The day on which the page was last modified.
  −
|-
  −
| <nowiki>{{REVISIONDAY2}}</nowiki>
  −
| <code>{{REVISIONDAY2}}</code>
  −
| '''[MW1.8+]''' The day on which the page was last modified, but with a leading zero (01 .. 31).
  −
|-
  −
| <nowiki>{{REVISIONMONTH}}</nowiki>
  −
| <code>{{REVISIONMONTH}}</code>
  −
| '''[MW1.8+]''' The month in which the page was last modified.
  −
|-
  −
| <nowiki>{{REVISIONYEAR}}</nowiki>
  −
| <code>{{REVISIONYEAR}}</code>
  −
| '''[MW1.8+]''' The year in which the page was last modified.
  −
|-
  −
| <nowiki>{{REVISIONTIMESTAMP}}</nowiki>
  −
| <code>{{REVISIONTIMESTAMP}}</code>
  −
| '''[MW1.8+]''' [[w:ISO 8601|ISO 8601]] time stamp, indicating when the page was last modified.
  −
|-
  −
| <nowiki>{{SITENAME}}</nowiki>
  −
| <code>{{SITENAME}}</code>
  −
| Value of {{h:mwg|Sitename}}.
  −
|-
  −
| <nowiki>{{SERVER}}</nowiki>
  −
| <small>{{SERVER}}</small>
  −
| Value of {{h:mwg|Server}} 
  −
|-
  −
| <nowiki>{{SCRIPTPATH}}</nowiki>
  −
| <code>{{SCRIPTPATH}}</code>
  −
| '''[MW1.5+]''' {{h:mwg|ScriptPath}}
  −
|-
  −
| <nowiki>{{SERVERNAME}}</nowiki>
  −
| <code>{{SERVERNAME}}</code>
  −
| '''[MW1.5+]''' {{h:mwg|ServerName}}
  −
|-
  −
|}{{-}}
      
==Parser functions==
 
==Parser functions==
    
:''For details see [[Help:Parser function]].''
 
:''For details see [[Help:Parser function]].''
 +
 +
Not working at the position of the page where the tag is located but on the page header, and throughout the page, respectively (see below):
 +
*DISPLAYTITLE: allow the page header to be different from the page name.
 +
*DEFAULTSORT: Sets a default [[Help:Categories#Sort_key|category sort key]] for the page.
    
=== Namespaces and URLs ===
 
=== Namespaces and URLs ===
Line 312: Line 238:  
| Returns the name of a given [[Help:Namespace|namespace number]].
 
| Returns the name of a given [[Help:Namespace|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><br /><nowiki>{{localurl:Wikipedia:Category}}</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}}<br />{{localurl:Wikipedia:Category}}</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, see [[Help:Variable]].
 
|- <!-- intentionally nbsp instead of sp for formatting reasons -->
 
|- <!-- intentionally nbsp instead of sp for formatting reasons -->
Line 359: Line 285:  
| '''[MW1.7+]''' Add [[w:Decimal_separator#Thousands_separator|decimal separators]] according to the wiki's default locale. Leading minus and plus are recognized.
 
| '''[MW1.7+]''' Add [[w:Decimal_separator#Thousands_separator|decimal separators]] according to the wiki's default locale. Leading minus and plus are recognized.
 
|-
 
|-
| <nowiki>{{padleft:}}</nowiki><br /><nowiki>{{padright:}}</nowiki>
+
|<nowiki>{{padleft:}}</nowiki><br /><br /><br /><br /><br /><nowiki>{{padright:}}</nowiki><br />
| <nowiki>{{padleft:bcd|6|a}}</nowiki> = <code>{{padleft:bcd|6|a}}</code><br /><nowiki>{{padleft:café|6|-}}</nowiki>={{padleft:café|6|-}}<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.
+
<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> (bug)<br/><br/>
 +
<nowiki>{{padleft:bcd|6|a}}</nowiki> = <code>{{padleft:bcd|6|a}}</code><br/>
 +
<nowiki>{{padleft:café|8|-}}</nowiki> = <code>{{padleft:café|8|-}}</code>(<==Bug effect)<br />
 +
<nowiki>{{padleft:cafe|8|-}}</nowiki> = <code>{{padleft:cafe|8|-}}</code><br />
 +
 
 +
<nowiki>{{padleft:bcd|6|{{!}}}}</nowiki> = <code>{{padleft:bcd|6|{{!}}}}</code><br/>
 +
<br/>
 +
<nowiki>{{padright:bcd|6|a}}</nowiki> = <code>{{padright:bcd|6|a}}</code><br />
 +
<nowiki>{{padright:0|6|a}}</nowiki> = <code>{{padright:0|6|a}}</code> (bug)<br />
 +
 
 +
|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.)
 +
 
 +
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.
 +
 
 +
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>
 
|}{{-}}
 
|}{{-}}
  −
A letter like é counts for two. It does not seem possible to use padleft and padright for padding with characters with a multi-character code, such as &amp;nbsp;, which would be useful with padleft for [[Help:Sorting|sorting tables]] with Javascript.
      
== Template modifiers ==
 
== Template modifiers ==
Line 375: Line 314:  
|-
 
|-
 
| <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 [[MediaWiki:xyz]] doesn't exist. See also [[Help:System message]].
 
|-
 
|-
 
| <nowiki>{{msg:xyz}}</nowiki>
 
| <nowiki>{{msg:xyz}}</nowiki>
| Try <nowiki>{{Template:xyz}}</nowiki> before [[Help:Magic words|magic word]] xyz, without this modifier it's the other way around. No additional effect if there is no template xyz.
+
| 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.
 
|-
 
|-
 
| <nowiki>{{msgnw:xyz}}</nowiki>
 
| <nowiki>{{msgnw:xyz}}</nowiki>
Line 384: Line 323:  
|-
 
|-
 
| <nowiki>{{raw:xyz}}</nowiki>
 
| <nowiki>{{raw:xyz}}</nowiki>
| '''[MW1.6+]''' Like <code>{&#123;msg:&#125;}</code> {{unclear}} [http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=12925]
+
| '''[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>.
 
|-
 
|-
 
| <nowiki>{{subst:xyz}}</nowiki>
 
| <nowiki>{{subst:xyz}}</nowiki>
Line 391: Line 330:     
== Image modifiers ==
 
== Image modifiers ==
:''For details see [[Centiare: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 [[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.
   Line 403: Line 342:  
| framed<br />frame<br />enframed
 
| framed<br />frame<br />enframed
 
| <nowiki>[[Image:Mediawiki.png|framed]]</nowiki>
 
| <nowiki>[[Image:Mediawiki.png|framed]]</nowiki>
| Places an image in a ''frame'' with a description. Uses original size.
+
| 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.
 +
|-
 +
| border
 +
| <nowiki>[[Image:Mediawiki.png|border]]</nowiki>
 +
| Shows a 1px border around the image.
 
|-
 
|-
 
| thumbnail<br />thumb
 
| thumbnail<br />thumb
 
| <nowiki>[[Image:Mediawiki.png|thumbnail]]</nowiki>
 
| <nowiki>[[Image:Mediawiki.png|thumbnail]]</nowiki>
| Modifies image size, sets it to dependant on user's favourite thumbnail size in their preferences.
+
| Modifies image size, sets it to dependant on user's favourite thumbnail size in their preferences, or on the given width parameter (see below).
 
|-
 
|-
 
| thumb=''xyz''
 
| thumb=''xyz''
 
| <nowiki>[[Image:Mediawiki.png|thumb=Wiki.png]]</nowiki>
 
| <nowiki>[[Image:Mediawiki.png|thumb=Wiki.png]]</nowiki>
 
| Manualthumb: instead of displaying an automatically-sized thumbnail for <var>Mediawiki.png</var>, display the image <var>Wiki.png</var>.
 
| Manualthumb: instead of displaying an automatically-sized thumbnail for <var>Mediawiki.png</var>, display the image <var>Wiki.png</var>.
|-
+
|-valign="top"
| ''width'' px
+
| ''width'' px<br>100x200px
| <nowiki>[[Image:Mediawiki.png|40px]]</nowiki>
+
| <nowiki>[[Image:Mediawiki.png|40px]]</nowiki><br><nowiki>[[Image:Mediawiki.png|100x200px]]</nowiki>
| Scales image to given ''width''&#160; in pixels
+
| 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 it's true aspect ratio within the boundary specified.
 
|}{{-}}
 
|}{{-}}
    
=== Position ===
 
=== Position ===
 
:''For details see [[Help:Images_and_other_uploaded_files]]''
 
:''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%"
 
! Word  
 
! Word  
Line 459: Line 402:  
| <nowiki>{{CONTENTLANGUAGE}}</nowiki>
 
| <nowiki>{{CONTENTLANGUAGE}}</nowiki>
 
| <code>{{CONTENTLANGUAGE}}</code>
 
| <code>{{CONTENTLANGUAGE}}</code>
| '''[MW1.7+]''' Default content {{h:mwg|LanguageCode}}
+
| '''[MW1.7+]''' code of the site's default interface language ({{h:mwg|LanguageCode}})
 
|-
 
|-
 
| <nowiki>{{DEFAULTSORT:xyz}}</nowiki>
 
| <nowiki>{{DEFAULTSORT:xyz}}</nowiki>
|  
+
| <nowiki>{{DEFAULTSORT:xyz}}</nowiki>
| '''[MW1.10+]''' Sets a default [[Help:Categories#Sort_key|category sort key]] for the current page<ref>"[[w:Wikipedia:Wikipedia Signpost/2007-01-02/Technology report|Technology report]]", en-Wikipedia Signpost, January 2007</ref>.
+
| '''[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>.
 
|-
 
|-
| <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 [[Help:Redirect|redirect]] to another page.
Line 493: Line 436:  
"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. See also [[:cs:Šablona:Wikivar/GRAMMAR]].
   −
"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 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 (oddly, first option is 1, 21, 31,.., 91, 101, 121, .., second is 2, 3, 4, 22, 23, 24, 31, 32, 33, 41,.., 94, 102, 103, 104,.., 122, 123,.., and else the third).
See also [[mediazilla:5805]] for the use of "plural" in system messages.
+
 
 +
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:
 +
*<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}}
   −
===See also===
+
(on e.g. the German and the Dutch sites reversed w.r.t. the result on English sites).
*[[m:ParserFunctions|Parser functions]] '''#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]
     −
==References==
+
"Plural" is used in various system messages, e.g. {{msg|nmembers}}, where it uses interface language instead of site language.
<div style="font-size:0.9em;"><references /></div>
  −
{{H:f|enname=Magic words}}
 
2,646

edits

Navigation menu