Content deleted Content added
Line 356:
Page IDs can be associated with articles via wikilinks (i.e. <code>[[Special:Redirect/page/3235121]]</code>goes to this page).
To output numbers without comma [[Delimiter|separator]]s (for example, as "123456789" rather than "123,456,789"), append the parameter <kbd>|R</kbd>.
{| class="wikitable plainrowheaders"▼
! scope=col | Code▼
! scope=col | Output▼
|-▼
|<syntaxhighlight lang="wikitext" inline>{{PAGESIZE}}</syntaxhighlight>▼
| {{suppress categories|{{PAGESIZE}}}}<!--To suppress the category "Pages which use a template in place of a magic word" generated by this erroneous usage-->▼
|-▼
|<syntaxhighlight lang="wikitext" inline>{{PAGESIZE:Help:Magic words}}</syntaxhighlight>▼
|{{PAGESIZE:Help:Magic words}}▼
|-▼
|<syntaxhighlight lang="wikitext" inline>{{subst:PAGESIZE:Help:Magic words}}</syntaxhighlight>▼
|{{PAGESIZE:Help:Magic words}}▼
|-▼
|<syntaxhighlight lang="wikitext" inline>{{PAGESIZE:{{FULLPAGENAME}}}}</syntaxhighlight>▼
|{{PAGESIZE:{{FULLPAGENAME}}}}▼
|-▼
|<syntaxhighlight lang="wikitext" inline>{{subst:PAGESIZE:{{FULLPAGENAME}}}}</syntaxhighlight>▼
|0▼
|-▼
|<syntaxhighlight lang="wikitext" inline>{{subst:PAGESIZE:{{subst:FULLPAGENAME}}}}</syntaxhighlight>▼
|{{PAGESIZE:{{FULLPAGENAME}}}}▼
|-▼
|}▼
===Formatting===
Line 401 ⟶ 375:
| Converts first character of ''string'' to upper case.
|-
! scope=row id=formatnum | <kbd>{<nowiki/>{formatnum:''unformatted_number''}}<br />{<nowiki/>{formatnum:''formatted_num'' {{pipe}}R}}</kbd>
| Adds comma separators to an ''unformatted_number'' (e.g. 123456789 becomes {{formatnum:123456789}}). To remove such formatting, use <kbd>{<nowiki/>{formatnum:''formatted_number''{{pipe}}R}}</kbd> (i.e. <kbd>{{braces|formatnum:7,654,321{{pipe}}R}}</kbd>, for example, produces {{formatnum:7,654,321|R}}).
|-
! scope=row id=dateformat | <kbd>{<nowiki/>{#dateformat:''date''{{pipe}}''format''}}<br />{<nowiki/>{#formatdate:''date''{{pipe}}''format''}}</kbd>
| Formats a date according to user preferences; a default can be given as an optional case-sensitive second parameter for users without date preference; can convert a date from an existing format to any of <code>dmy</code>, <code>mdy</code>, <code>ymd</code>, or <code>[[ISO 8601]]</code> formats, with the user's preference overriding the specified format.
|-
! scope=row id=padleft | <kbd>{<nowiki/>{padleft:''xyz''{{pipe}}''stringlength''}}<br />{<nowiki/>{padright:''xyz''{{pipe}}''stringlength''}}<br /><br />{<nowiki/>{padleft:''xyz''{{pipe}}''length''{{pipe}}''padstr''}}<br />{<nowiki/>{padright:''xyz''{{pipe}}''length''{{pipe}}''padstr''}}</kbd>
| Pad with zeroes '0' to the right or left, to fill the given length; an alternative padding string can be given as a third parameter; the repeated padding string (''padstr'') will be truncated if its length does not evenly divide the required number of characters.
|-
Line 413 ⟶ 387:
| Outputs ''singular'' if ''N'' is equal to 1, otherwise outputs ''plural''. See the [[mw:Help:Magic words#Localization|documentation at mediawiki.org]] for more details.
|-
! scope=row id=mwtime | <kbd>{<nowiki/>{#time:''format''{{pipe}}''object''}}</kbd><br /><kbd>{<nowiki/>{#timel:''format''{{pipe}}''object''}}<br /><br />{<nowiki/>{#time:d F Y{{pipe}}''date''{{pipe}}''langcode''}}</kbd>
| Used to format dates and times, for ISO format, dots or English month names. <kbd>#timel</kbd> is based on local time as defined for each wiki; for English Wikipedia, this is identical to <kbd>#time</kbd>.<br />The optional 3rd parameter is the output language code (French, German, Swedish: fr, de, sv, etc.). Example Finnish: <kbd><nowiki>{{#time:d F Y|June 30, 2016|fi}}</nowiki></kbd> shows: {{#time:d F Y|June 30, 2016|fi}} (June). ISO to German: <kbd><nowiki>{{#time:d. M Y|1987-10-31|de}}</nowiki></kbd> shows: {{#time:d. M Y|1987-10-31|de}}.<br />For format codes, see: [[mw:Help:Extension:ParserFunctions##time]]. Use the format <kbd><nowiki>{{#time: H:i, j F Y (e)|...}}</nowiki></kbd> to match the format used by timestamps in signatures.
|-
Line 537 ⟶ 511:
! scope=row id=equals | <kbd>[[mw:Help:Magic_words#Other|{<nowiki/>{=}}]] </kbd>
| Used to include an equal sign as part of a template argument or table cell contents. Before this was added as a magic word, many wikis implemented this by creating [[:Template:=]] with <code>{{=}}</code> as the content.
▲|}
===Substituting and nesting ===
Magic words can sometimes behave weirdly when [[WP:SUBST|substituted]] or nested. Here are some examples of how this works:
▲{| class="wikitable plainrowheaders"
▲! scope=col | Code
▲! scope=col | Output
▲|-
▲|<syntaxhighlight lang="wikitext" inline>{{PAGESIZE}}</syntaxhighlight>
▲| {{suppress categories|{{PAGESIZE}}}}<!--To suppress the category "Pages which use a template in place of a magic word" generated by this erroneous usage-->
▲|-
▲|<syntaxhighlight lang="wikitext" inline>{{PAGESIZE:Help:Magic words}}</syntaxhighlight>
▲|{{PAGESIZE:Help:Magic words}}
▲|-
▲|<syntaxhighlight lang="wikitext" inline>{{subst:PAGESIZE:Help:Magic words}}</syntaxhighlight>
▲|{{PAGESIZE:Help:Magic words}}
▲|-
▲|<syntaxhighlight lang="wikitext" inline>{{PAGESIZE:{{FULLPAGENAME}}}}</syntaxhighlight>
▲|{{PAGESIZE:{{FULLPAGENAME}}}}
▲|-
▲|<syntaxhighlight lang="wikitext" inline>{{subst:PAGESIZE:{{FULLPAGENAME}}}}</syntaxhighlight>
▲|0
▲|-
|<syntaxhighlight lang="wikitext" inline>{{PAGESIZE:{{subst:FULLPAGENAME}}}}</syntaxhighlight>
|{{PAGESIZE:Help:Magic words}}
▲|-
▲|<syntaxhighlight lang="wikitext" inline>{{subst:PAGESIZE:{{subst:FULLPAGENAME}}}}</syntaxhighlight>
▲|{{PAGESIZE:{{FULLPAGENAME}}}}
|-
|}
|