「ヘルプ:Magic words」の版間の差分
細 (1版) |
細 (fix) |
||
1行目: | 1行目: | ||
− | '''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}}. | + | <languages/> |
+ | {{TNT|PD Help Page}} | ||
+ | <translate> | ||
+ | {{hatnote|"Help:Variables" redirects here. For PHP global variables used internally in MediaWiki, see [[Manual:wg variable]].}} | ||
+ | <!--T:1--> | ||
+ | '''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|Special:MyLanguage/Manual:Magic words|Manual:Magic words}}. | ||
+ | <!--T:2--> | ||
There are three general types of magic words: | There are three general types of magic words: | ||
+ | |||
+ | <!--T:3--> | ||
* '''[[#Behavior switches|Behavior switches]]''': these are uppercase words surrounded by double underscores, ''e.g.'' '''__FOO__'''. | * '''[[#Behavior switches|Behavior switches]]''': these are uppercase words surrounded by double underscores, ''e.g.'' '''__FOO__'''. | ||
− | |||
− | |||
− | Variables and parser functions can use [[Manual:subst|subst:]], just like templates. 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. | + | <!--T:4--> |
+ | * '''[[#Variables|Variables]]''': these are uppercase words surrounded by double braces, ''e.g.'' '''<code><nowiki>{{FOO}}</nowiki></code>'''. As such, they look a lot like [[Special:MyLanguage/Help:Templates|templates]]. | ||
+ | |||
+ | <!--T:5--> | ||
+ | * '''[[#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|Special:MyLanguage/Help:Extension:ParserFunctions|Help:Extension:ParserFunctions}}. | ||
+ | |||
+ | <!--T:6--> | ||
+ | Variables and parser functions can use [[Special:MyLanguage/Manual:subst|subst:]], just like templates. 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. | ||
+ | </translate> | ||
− | == Behavior switches == | + | {{anchor|Behavior switches}} |
+ | <translate> | ||
+ | == Behavior switches == <!--T:7--> | ||
+ | <!--T:8--> | ||
A behavior switch controls the layout or behavior of the page and can often be used to specify desired omissions and inclusions in the content. | A behavior switch controls the layout or behavior of the page and can often be used to specify desired omissions and inclusions in the content. | ||
+ | </translate> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Word | + | ! <translate><!--T:9--> |
− | ! Description | + | Word</translate> |
− | ! Versions | + | ! <translate><!--T:10--> |
+ | Description</translate> | ||
+ | ! <translate><!--T:11--> | ||
+ | Versions</translate> | ||
|- | |- | ||
− | ! colspan="3" style="background-color: #DDDDDD;"| [[Table of contents]] | + | ! colspan="3" style="background-color: #DDDDDD;"| <translate><!--T:257--> |
+ | [[Special:MyLanguage/Table of contents|Table of contents]]</translate> | ||
|- | |- | ||
| <code><nowiki>__NOTOC__</nowiki></code> | | <code><nowiki>__NOTOC__</nowiki></code> | ||
− | | Hides the [[table of contents]] (TOC). | + | | <translate><!--T:12--> |
+ | Hides the [[Special:MyLanguage/table of contents|table of contents]] (TOC).</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>__FORCETOC__</nowiki></code> | | <code><nowiki>__FORCETOC__</nowiki></code> | ||
− | | Forces the table of contents to appear at its normal position (before the first header). | + | | <translate><!--T:13--> |
+ | Forces the table of contents to appear at its normal position (before the first header).</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>__TOC__</nowiki></code> | | <code><nowiki>__TOC__</nowiki></code> | ||
− | | 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. | + | | <translate><!--T:14--> |
+ | 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.</translate> | ||
| | | | ||
|- | |- | ||
− | ! colspan="3" style="background-color: #DDDDDD;"| Editing | + | ! colspan="3" style="background-color: #DDDDDD;"| <translate><!--T:15--> |
+ | Editing</translate> | ||
|- | |- | ||
| <code><nowiki>__NOEDITSECTION__</nowiki></code> | | <code><nowiki>__NOEDITSECTION__</nowiki></code> | ||
− | | Hides the section edit links beside headings. This is especially useful, where a heading is created from within a template: the normal wiki section-edit would in this case edit the template code, which is normally counterintuitive to the user. If a template contains multiple headings, it may be necessary to add "<code><nowiki>__NOEDITSECTION__</nowiki></code>" after each heading. | + | | <translate><!--T:16--> |
+ | Hides the section edit links beside headings. This is especially useful, where a heading is created from within a template: the normal wiki section-edit would in this case edit the template code, which is normally counterintuitive to the user. If a template contains multiple headings, it may be necessary to add "<code><nowiki>__NOEDITSECTION__</nowiki></code>" after each heading.</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>__NEWSECTIONLINK__</nowiki></code> | | <code><nowiki>__NEWSECTIONLINK__</nowiki></code> | ||
− | | Adds a link 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}}). | + | | <translate><!--T:17--> |
− | | 1.7 | + | Adds a link beside the "edit" tab for adding a new section on a non-talk page (see {{mediawiki|m:Special:MyLanguage/Help:Section#Adding a section at the end|Adding a section to the end}}).</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>__NONEWSECTIONLINK__</nowiki></code> | | <code><nowiki>__NONEWSECTIONLINK__</nowiki></code> | ||
− | | Removes the link beside the "edit" tab on pages in talk namespaces. | + | | <translate><!--T:18--> |
− | | {{ | + | Removes the link beside the "edit" tab on pages in talk namespaces.</translate> |
+ | | {{MW version|version=1.15|compact=y|comment=and after|r=47522}} | ||
|- | |- | ||
− | ! colspan="3"| Categories | + | ! colspan="3"| <translate><!--T:19--> |
+ | Categories</translate> | ||
|- | |- | ||
| <code><nowiki>__NOGALLERY__</nowiki></code> | | <code><nowiki>__NOGALLERY__</nowiki></code> | ||
− | | Used on a category page, replaces thumbnails in the category view with normal links. | + | | <translate><!--T:20--> |
− | | 1.7 | + | Used on a category page, replaces thumbnails in the category view with normal links.</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>__HIDDENCAT__</nowiki></code> | | <code><nowiki>__HIDDENCAT__</nowiki></code> | ||
− | | 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 --> | + | | <translate><!--T:21--> |
− | | 1.13 | + | 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 [[Special:MyLanguage/Help:Preferences|user preferences]] to show them).</translate><!-- hiddencategory hiddencat hide category categories --> |
+ | | {{MW version|version=1.13|compact=y|comment=and after}} | ||
|- | |- | ||
− | ! colspan="3" style="background-color: #DDDDDD;"| Language conversion | + | ! colspan="3" style="background-color: #DDDDDD;"| <translate><!--T:22--> |
+ | Language conversion</translate> | ||
|- | |- | ||
| <code><nowiki>__NOCONTENTCONVERT__</nowiki></code> <br /> <code><nowiki>__NOCC__</nowiki></code> | | <code><nowiki>__NOCONTENTCONVERT__</nowiki></code> <br /> <code><nowiki>__NOCC__</nowiki></code> | ||
− | | 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. | + | | <translate><!--T:23--> |
+ | 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.</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>__NOTITLECONVERT__</nowiki></code> <br /> <code><nowiki>__NOTC__</nowiki></code> | | <code><nowiki>__NOTITLECONVERT__</nowiki></code> <br /> <code><nowiki>__NOTC__</nowiki></code> | ||
− | | On wikis with language variants, don't perform language conversion on the title (all other content is converted). | + | | <translate><!--T:24--> |
+ | On wikis with language variants, don't perform language conversion on the title (all other content is converted).</translate> | ||
| | | | ||
|- | |- | ||
− | ! colspan="3" style="background-color: #DDDDDD;"| Other | + | ! colspan="3" style="background-color: #DDDDDD;"| <translate><!--T:25--> |
+ | Other</translate> | ||
|- | |- | ||
| <code><nowiki>__START__</nowiki></code> | | <code><nowiki>__START__</nowiki></code> | ||
− | | No effect. | + | | <translate><!--T:26--> |
+ | No effect.</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>__END__</nowiki></code> | | <code><nowiki>__END__</nowiki></code> | ||
− | | Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in {{mediawiki|rev:19213|19213}}. | + | | <translate><!--T:27--> |
− | | 1. | + | Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in {{mediawiki|rev:19213|19213}}.</translate> |
+ | | {{MW version|version=1.1|compact=y|version2=1.8}} | ||
|- | |- | ||
| <code><nowiki>__INDEX__</nowiki></code> | | <code><nowiki>__INDEX__</nowiki></code> | ||
− | | Tell search engines to index the page (overrides {{mediawiki|Manual:$wgArticleRobotPolicies|$wgArticleRobotPolicies}}, but not robots.txt). It obeys [[Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]] variable. | + | | <translate><!--T:28--> |
− | | 1.14 | + | Tell search engines to index the page (overrides {{mediawiki|Special:MyLanguage/Manual:$wgArticleRobotPolicies|$wgArticleRobotPolicies}}, but not robots.txt). It obeys [[Special:MyLanguage/Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]] variable.</translate> |
+ | | {{MW version|version=1.14|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>__NOINDEX__</nowiki></code> | | <code><nowiki>__NOINDEX__</nowiki></code> | ||
− | | Tell search engines not to index the page (i.e. do not list in search engines' results). It obeys [[Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]] variable. | + | | <translate><!--T:29--> |
− | | {{ | + | Tell search engines not to index the page (i.e. do not list in search engines' results). It obeys [[Special:MyLanguage/Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]] variable.</translate> |
+ | | {{MW version|version=1.14|compact=y|comment=and after|r=37973}} | ||
|- | |- | ||
| <code><nowiki>__STATICREDIRECT__</nowiki></code> | | <code><nowiki>__STATICREDIRECT__</nowiki></code> | ||
− | | On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks " | + | | <translate><!--T:30--> |
− | | {{ | + | On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "{{int:Fix-double-redirects}}".</translate> |
+ | | {{MW version|version=1.13|compact=y|comment=and after|r=37928}} | ||
|- | |- | ||
| <code><nowiki>__DISAMBIG__</nowiki></code> | | <code><nowiki>__DISAMBIG__</nowiki></code> | ||
− | | Marks a page as a disambiguation page and places it in [[Special:DisambiguationPages]], and places inward links in [[Special:DisambiguationPageLinks]]. See [[Extension:Disambiguator]]. | + | | <translate><!--T:31--> |
− | | requires [[Extension:Disambiguator|Disambiguator extension]] | + | Marks a page as a disambiguation page and places it in [[Special:DisambiguationPages]], and places inward links in [[Special:DisambiguationPageLinks]]. See [[Special:MyLanguage/Extension:Disambiguator|Extension:Disambiguator]].</translate> |
+ | | <translate><!--T:32--> | ||
+ | requires [[Special:MyLanguage/Extension:Disambiguator|Disambiguator extension]]</translate> | ||
|} | |} | ||
− | == Variables == | + | <translate> |
+ | == Variables == <!--T:33--> | ||
− | 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. | + | <!--T:34--> |
+ | Variables return information about the current page, wiki, or date. Their syntax is similar to [[Special:MyLanguage/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. | ||
+ | <!--T:35--> | ||
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. | 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 === | + | === Date and time === <!--T:36--> |
+ | <!--T:37--> | ||
The following variables return the current date and time in [[w:UTC|UTC]]. | The following variables return the current date and time in [[w:UTC|UTC]]. | ||
+ | <!--T:38--> | ||
Due to MediaWiki and browser caching, these variables frequently show when the page was ''cached'' rather than the current time. | Due to MediaWiki and browser caching, these variables frequently show when the page was ''cached'' rather than the current time. | ||
− | The date and time magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, they depend on the [[page content language]]. | + | <!--T:39--> |
+ | The date and time magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, they depend on the [[Special:MyLanguage/page content language|page content language]]. | ||
+ | </translate> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Variable | + | ! <translate><!--T:40--> |
− | ! Output | + | Variable</translate> |
− | ! Description | + | ! <translate><!--T:41--> |
− | ! Versions | + | Output</translate> |
+ | ! <translate><!--T:42--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:43--> | ||
+ | Versions</translate> | ||
|- | |- | ||
− | ! colspan="4" style="background-color: #DDDDDD;"| Year{{Anchor|CURRENTYEAR}} | + | ! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:44--> |
+ | Year</translate>{{Anchor|CURRENTYEAR}} | ||
|- | |- | ||
| <code><nowiki>{{CURRENTYEAR}}</nowiki></code> | | <code><nowiki>{{CURRENTYEAR}}</nowiki></code> | ||
| {{CURRENTYEAR}} | | {{CURRENTYEAR}} | ||
− | | Year | + | | <translate><!--T:45--> |
+ | Year</translate> | ||
| | | | ||
|- | |- | ||
− | ! colspan="4" style="background-color: #DDDDDD;"| Month{{Anchor|CURRENTMONTH|CURRENTMONTHNAME|CURRENTMONTHNAMEGEN|CURRENTMONTHABBREV}} | + | ! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:46--> |
+ | Month</translate>{{Anchor|CURRENTMONTH|CURRENTMONTHNAME|CURRENTMONTHNAMEGEN|CURRENTMONTHABBREV}} | ||
|- | |- | ||
| <code><nowiki>{{CURRENTMONTH}}</nowiki></code> | | <code><nowiki>{{CURRENTMONTH}}</nowiki></code> | ||
| {{CURRENTMONTH}} | | {{CURRENTMONTH}} | ||
− | | Month (zero-padded number) | + | | <translate><!--T:47--> |
+ | Month (zero-padded number)</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{CURRENTMONTHNAME}}</nowiki></code> | | <code><nowiki>{{CURRENTMONTHNAME}}</nowiki></code> | ||
| {{CURRENTMONTHNAME}} | | {{CURRENTMONTHNAME}} | ||
− | | Month (name) | + | | <translate><!--T:48--> |
+ | Month (name)</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki></code> | | <code><nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki></code> | ||
| {{CURRENTMONTHNAMEGEN}} | | {{CURRENTMONTHNAMEGEN}} | ||
− | | Month ([[wikipedia:genitive|genitive form]]) | + | | <translate><!--T:49--> |
+ | Month ([[wikipedia:genitive|genitive form]])</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{CURRENTMONTHABBREV}}</nowiki></code> | | <code><nowiki>{{CURRENTMONTHABBREV}}</nowiki></code> | ||
| {{CURRENTMONTHABBREV}} | | {{CURRENTMONTHABBREV}} | ||
− | | Month (abbreviation) | + | | <translate><!--T:50--> |
− | | 1.5 | + | Month (abbreviation)</translate> |
+ | | {{MW version|version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
− | ! colspan="4" style="background-color: #DDDDDD;"| Day{{Anchor|CURRENTDAY|CURRENTDAY2|CURRENTDOW|CURRENTDAYNAME}} | + | ! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:51--> |
+ | Day</translate>{{Anchor|CURRENTDAY|CURRENTDAY2|CURRENTDOW|CURRENTDAYNAME}} | ||
|- | |- | ||
| <code><nowiki>{{CURRENTDAY}}</nowiki></code> | | <code><nowiki>{{CURRENTDAY}}</nowiki></code> | ||
| {{CURRENTDAY}} | | {{CURRENTDAY}} | ||
− | | Day of the month (unpadded number) | + | | <translate><!--T:52--> |
+ | Day of the month (unpadded number)</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{CURRENTDAY2}}</nowiki></code> | | <code><nowiki>{{CURRENTDAY2}}</nowiki></code> | ||
| {{CURRENTDAY2}} | | {{CURRENTDAY2}} | ||
− | | Day of the month (zero-padded number) | + | | <translate><!--T:53--> |
− | | 1.6 | + | Day of the month (zero-padded number)</translate> |
+ | | {{MW version|version=1.6|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{CURRENTDOW}}</nowiki></code> | | <code><nowiki>{{CURRENTDOW}}</nowiki></code> | ||
| {{CURRENTDOW}} | | {{CURRENTDOW}} | ||
− | | Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday) | + | | <translate><!--T:54--> |
+ | Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday)</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{CURRENTDAYNAME}}</nowiki></code> | | <code><nowiki>{{CURRENTDAYNAME}}</nowiki></code> | ||
| {{CURRENTDAYNAME}} | | {{CURRENTDAYNAME}} | ||
− | | Day of the week (name) | + | | <translate><!--T:55--> |
+ | Day of the week (name)</translate> | ||
| | | | ||
|- | |- | ||
− | ! colspan="4" style="background-color: #DDDDDD;"| Time{{Anchor|CURRENTTIME|CURRENTHOUR}} | + | ! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:56--> |
+ | Time</translate>{{Anchor|CURRENTTIME|CURRENTHOUR}} | ||
|- | |- | ||
| <code><nowiki>{{CURRENTTIME}}</nowiki></code> | | <code><nowiki>{{CURRENTTIME}}</nowiki></code> | ||
| {{CURRENTTIME}} | | {{CURRENTTIME}} | ||
− | | Time (24-hour HH:mm format) | + | | <translate><!--T:57--> |
+ | Time (24-hour HH:mm format)</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{CURRENTHOUR}}</nowiki></code> | | <code><nowiki>{{CURRENTHOUR}}</nowiki></code> | ||
| {{CURRENTHOUR}} | | {{CURRENTHOUR}} | ||
− | | Hour (24-hour zero-padded number) | + | | <translate><!--T:58--> |
+ | Hour (24-hour zero-padded number)</translate> | ||
| | | | ||
|- | |- | ||
− | ! colspan="4" style="background-color: #DDDDDD;"| Other{{Anchor|CURRENTWEEK|CURRENTTIMESTAMP}} | + | ! colspan="4" style="background-color: #DDDDDD;"| <translate><!--T:59--> |
+ | Other</translate>{{Anchor|CURRENTWEEK|CURRENTTIMESTAMP}} | ||
|- | |- | ||
| <code><nowiki>{{CURRENTWEEK}}</nowiki></code> | | <code><nowiki>{{CURRENTWEEK}}</nowiki></code> | ||
| {{CURRENTWEEK}} | | {{CURRENTWEEK}} | ||
− | | Week (number) | + | | <translate><!--T:60--> |
+ | Week (number)</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{CURRENTTIMESTAMP}}</nowiki></code> | | <code><nowiki>{{CURRENTTIMESTAMP}}</nowiki></code> | ||
| {{CURRENTTIMESTAMP}} | | {{CURRENTTIMESTAMP}} | ||
− | | YYYYMMDDHHmmss timestamp | + | | <translate><!--T:61--> |
− | | 1.7 | + | YYYYMMDDHHmmss timestamp</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|} | |} | ||
− | The following variables do the same as the preceding ones, but using the site's server config or $wgLocaltimezone. | + | <translate> |
+ | <!--T:62--> | ||
+ | The following variables do the same as the preceding ones, but using the site's server config or [[Special:MyLanguage/Manual:$wgLocaltimezone|$wgLocaltimezone]]. | ||
+ | </translate> | ||
* <code><nowiki>{{LOCALYEAR}}</nowiki> | * <code><nowiki>{{LOCALYEAR}}</nowiki> | ||
* <nowiki>{{LOCALMONTH}}</nowiki> | * <nowiki>{{LOCALMONTH}}</nowiki> | ||
205行目: | 280行目: | ||
* <nowiki>{{LOCALTIMESTAMP}}</nowiki></code> | * <nowiki>{{LOCALTIMESTAMP}}</nowiki></code> | ||
− | ''For more thorough time formatting, you may want to install [[Extension:ParserFunctions]] to use the [[Help:Extension:ParserFunctions#.23time|#time parser function]]''. | + | <translate> |
+ | <!--T:63--> | ||
+ | ''For more thorough time formatting, you may want to install [[Special:MyLanguage/Extension:ParserFunctions|Extension:ParserFunctions]] to use the [[Special:MyLanguage/Help:Extension:ParserFunctions#.23time|#time parser function]]''. | ||
− | === Technical metadata === | + | === Technical metadata === <!--T:64--> |
+ | <!--T:65--> | ||
''Note:'' Revision variables return data about the '''latest edit to the current page''', even if viewing an older version of the page. | ''Note:'' Revision variables return data about the '''latest edit to the current page''', even if viewing an older version of the page. | ||
+ | </translate> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Variable | + | ! <translate><!--T:66--> |
− | ! Output | + | Variable</translate> |
− | ! Description | + | ! <translate><!--T:67--> |
− | ! Versions | + | Output</translate> |
+ | ! <translate><!--T:68--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:69--> | ||
+ | Versions</translate> | ||
|- | |- | ||
− | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Site|SITENAME|SERVER|SERVERNAME|DIRMARK|DIRECTIONMARK}}{{Anchor|SCRIPTPATH|STYLEPATH|CURRENTVERSION|CONTENTLANGUAGE|CONTENTLANG}}Site | + | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Site|SITENAME|SERVER|SERVERNAME|DIRMARK|DIRECTIONMARK}}{{Anchor|SCRIPTPATH|STYLEPATH|CURRENTVERSION|CONTENTLANGUAGE|CONTENTLANG}}<translate><!--T:70--> |
+ | Site</translate> | ||
|- | |- | ||
| <code><nowiki>{{SITENAME}}</nowiki></code> | | <code><nowiki>{{SITENAME}}</nowiki></code> | ||
| {{SITENAME}} | | {{SITENAME}} | ||
− | | The wiki's site name ({{mediawiki|Manual:$wgSitename|$wgSitename}}). | + | | <translate><!--T:71--> |
+ | The wiki's site name ({{mediawiki|Special:MyLanguage/Manual:$wgSitename|$wgSitename}}).</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{SERVER}}</nowiki></code> | | <code><nowiki>{{SERVER}}</nowiki></code> | ||
| {{SERVER}} | | {{SERVER}} | ||
− | | Domain [ | + | | <translate><!--T:72--> |
+ | Domain [[w:URL|URL]] ({{mediawiki|Special:MyLanguage/Manual:$wgServer|$wgServer}}).</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{SERVERNAME}}</nowiki></code> | | <code><nowiki>{{SERVERNAME}}</nowiki></code> | ||
| {{SERVERNAME}} | | {{SERVERNAME}} | ||
− | | Subdomain and domain name (no longer dependent on {{mediawiki|Manual:$wgServerName|$wgServerName}} as of version 1.17). | + | | <translate><!--T:73--> |
+ | Subdomain and domain name (no longer dependent on {{mediawiki|Special:MyLanguage/Manual:$wgServerName|$wgServerName}} as of version 1.17).</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{DIRMARK}}</nowiki></code> <br /><code><nowiki>{{DIRECTIONMARK}}</nowiki></code> | | <code><nowiki>{{DIRMARK}}</nowiki></code> <br /><code><nowiki>{{DIRECTIONMARK}}</nowiki></code> | ||
| {{DIRMARK}} <br />{{DIRECTIONMARK}} | | {{DIRMARK}} <br />{{DIRECTIONMARK}} | ||
− | | Outputs a [ | + | | <translate><!--T:74--> |
− | | {{ | + | Outputs a [[w:Unicode|Unicode]] directional mark that matches the wiki's default language's direction (<code>&lrm;</code> on left-to-right wikis, <code>&rlm;</code> on right-to-left wikis), useful in text with multi-directional text. Since {{r|94680|1.19}}, it depends on the [[Special:MyLanguage/page content language|page content language]].</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after|r=14442}} | ||
|- | |- | ||
| <code><nowiki>{{SCRIPTPATH}}</nowiki></code> | | <code><nowiki>{{SCRIPTPATH}}</nowiki></code> | ||
| {{SCRIPTPATH}} | | {{SCRIPTPATH}} | ||
− | | Relative script path ({{mediawiki|Manual:$wgScriptPath|$wgScriptPath}}). | + | | <translate><!--T:75--> |
+ | Relative script path ({{mediawiki|Special:MyLanguage/Manual:$wgScriptPath|$wgScriptPath}}).</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{STYLEPATH}}</nowiki></code> | | <code><nowiki>{{STYLEPATH}}</nowiki></code> | ||
| {{STYLEPATH}} | | {{STYLEPATH}} | ||
− | | Relative style path ({{mediawiki|Manual:$wgStylePath|$wgStylePath}}). | + | | <translate><!--T:76--> |
− | | 1.16 | + | Relative style path ({{mediawiki|Special:MyLanguage/Manual:$wgStylePath|$wgStylePath}}).</translate> |
+ | | {{MW version|version=1.16|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{CURRENTVERSION}}</nowiki></code> | | <code><nowiki>{{CURRENTVERSION}}</nowiki></code> | ||
| {{CURRENTVERSION}} | | {{CURRENTVERSION}} | ||
− | | The wiki's MediaWiki version. | + | | <translate><!--T:77--> |
− | | {{ | + | The wiki's MediaWiki version.</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after|r=14199}} | ||
|- | |- | ||
| <code><nowiki>{{CONTENTLANGUAGE}}</nowiki></code> <br /><code><nowiki>{{CONTENTLANG}}</nowiki></code> | | <code><nowiki>{{CONTENTLANGUAGE}}</nowiki></code> <br /><code><nowiki>{{CONTENTLANG}}</nowiki></code> | ||
| {{CONTENTLANGUAGE}} <br />{{CONTENTLANG}} | | {{CONTENTLANGUAGE}} <br />{{CONTENTLANG}} | ||
− | | The wiki's default interface language ({{mediawiki|Manual:$wgLanguageCode|$wgLanguageCode}}). | + | | <translate><!--T:78--> |
− | | {{ | + | The wiki's default interface language ({{mediawiki|Special:MyLanguage/Manual:$wgLanguageCode|$wgLanguageCode}}).</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after|r=14661}} | ||
|- | |- | ||
− | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Page|PAGEID|PAGESIZE|PROTECTIONLEVEL}}Page | + | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Page|PAGEID|PAGESIZE|PROTECTIONLEVEL}}<translate><!--T:79--> |
+ | Page</translate> | ||
|- | |- | ||
| <code><nowiki>{{PAGEID}}</nowiki></code> | | <code><nowiki>{{PAGEID}}</nowiki></code> | ||
| {{PAGEID}} | | {{PAGEID}} | ||
− | | Returns the page identifier. | + | | <translate><!--T:80--> |
− | | | + | Returns the page identifier.</translate> |
+ | | [[gerrit:9858|{{MW version|version=1.20|compact=y|comment=and after}}]] <br />[[gerrit:9858]] | ||
|- | |- | ||
| <code><nowiki>{{</nowiki>PROTECTIONLEVEL: ''action'' }}</code> | | <code><nowiki>{{</nowiki>PROTECTIONLEVEL: ''action'' }}</code> | ||
| <!-- Leave this empty. --> | | <!-- Leave this empty. --> | ||
− | | Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the current page. Returns an empty string if not protected. | + | | <translate><!--T:81--> |
− | | {{ | + | Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the current page. Returns an empty string if not protected.</translate> |
+ | | {{MW version|version=1.15|compact=y|comment=and after|r=45587}} | ||
|- | |- | ||
− | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|revision|REVISIONID|REVISIONDAY|REVISIONDAY2|REVISIONMONTH|REVISIONMONTH1|REVISIONYEAR|REVISIONTIMESTAMP|REVISIONUSER}}Latest revision to current page | + | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|revision|REVISIONID|REVISIONDAY|REVISIONDAY2|REVISIONMONTH|REVISIONMONTH1|REVISIONYEAR|REVISIONTIMESTAMP|REVISIONUSER}}<translate><!--T:82--> |
+ | Latest revision to current page</translate> | ||
|- | |- | ||
| <code><nowiki>{{REVISIONID}}</nowiki></code> | | <code><nowiki>{{REVISIONID}}</nowiki></code> | ||
| {{REVISIONID}} | | {{REVISIONID}} | ||
− | | Unique revision ID. | + | | <translate><!--T:83--> |
− | | 1.5 | + | Unique revision ID.</translate> |
+ | | {{MW version|version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{REVISIONDAY}}</nowiki></code> | | <code><nowiki>{{REVISIONDAY}}</nowiki></code> | ||
| {{REVISIONDAY}} | | {{REVISIONDAY}} | ||
− | | Day edit was made (unpadded number). | + | | <translate><!--T:84--> |
− | | 1.8 | + | Day edit was made (unpadded number).</translate> |
+ | | {{MW version|version=1.8|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{REVISIONDAY2}}</nowiki></code> | | <code><nowiki>{{REVISIONDAY2}}</nowiki></code> | ||
| {{REVISIONDAY2}} | | {{REVISIONDAY2}} | ||
− | | Day edit was made (zero-padded number). | + | | <translate><!--T:85--> |
− | | 1.8 | + | Day edit was made (zero-padded number).</translate> |
+ | | {{MW version|version=1.8|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{REVISIONMONTH}}</nowiki></code> | | <code><nowiki>{{REVISIONMONTH}}</nowiki></code> | ||
| {{REVISIONMONTH}} | | {{REVISIONMONTH}} | ||
− | | Month edit was made (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions). | + | | <translate><!--T:86--> |
− | | 1.8 | + | Month edit was made (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions).</translate> |
+ | | {{MW version|version=1.8|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{REVISIONMONTH1}}</nowiki></code> | | <code><nowiki>{{REVISIONMONTH1}}</nowiki></code> | ||
| {{REVISIONMONTH1}} | | {{REVISIONMONTH1}} | ||
− | | Month edit was made (unpadded number). | + | | <translate><!--T:87--> |
− | | {{ | + | Month edit was made (unpadded number).</translate> |
+ | | {{MW version|version=1.17|compact=y|comment=and after|r=66200}} | ||
|- | |- | ||
| <code><nowiki>{{REVISIONYEAR}}</nowiki></code> | | <code><nowiki>{{REVISIONYEAR}}</nowiki></code> | ||
| {{REVISIONYEAR}} | | {{REVISIONYEAR}} | ||
− | | Year edit was made. | + | | <translate><!--T:88--> |
− | | 1.8 | + | Year edit was made.</translate> |
+ | | {{MW version|version=1.8|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{REVISIONTIMESTAMP}}</nowiki></code> | | <code><nowiki>{{REVISIONTIMESTAMP}}</nowiki></code> | ||
| {{REVISIONTIMESTAMP}} | | {{REVISIONTIMESTAMP}} | ||
− | | Timestamp as of time of edit. | + | | <translate><!--T:89--> |
− | | 1.8 | + | Timestamp as of time of edit.</translate> |
+ | | {{MW version|version=1.8|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{REVISIONUSER}}</nowiki></code><br /><code><nowiki>{{URLENCODE:{{REVISIONUSER}}|WIKI}}</nowiki></code> | | <code><nowiki>{{REVISIONUSER}}</nowiki></code><br /><code><nowiki>{{URLENCODE:{{REVISIONUSER}}|WIKI}}</nowiki></code> | ||
| {{REVISIONUSER}}<br />{{URLENCODE:{{REVISIONUSER}}|WIKI}} | | {{REVISIONUSER}}<br />{{URLENCODE:{{REVISIONUSER}}|WIKI}} | ||
− | | The username of the user who made the most recent edit to the page, or the current user when previewing an edit. | + | | <translate><!--T:90--> |
− | | {{ | + | The username of the user who made the most recent edit to the page, or the current user when previewing an edit.</translate> |
+ | | {{MW version|version=1.15|compact=y|comment=and after|r=48149}} | ||
|- | |- | ||
| <code><nowiki>{{REVISIONSIZE}}</nowiki></code> | | <code><nowiki>{{REVISIONSIZE}}</nowiki></code> | ||
| {{REVISIONSIZE}} | | {{REVISIONSIZE}} | ||
− | | The size (bytes of wikitext) of the current revision of this page | + | | <translate><!--T:91--> |
− | | {{ | + | The size (bytes of wikitext) of the current revision of this page</translate> |
+ | | {{MW version|version=1.22|compact=y|comment=and after}}<br />[[gerrit:82650]] | ||
|- | |- | ||
− | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|DISPLAYTITLE|DEAFULTSORT|DEFAULTCATEGORYSORT|DEFAULTSORTKEY}}Affects page content | + | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|DISPLAYTITLE|DEAFULTSORT|DEFAULTCATEGORYSORT|DEFAULTSORTKEY}}<translate><!--T:92--> |
+ | Affects page content</translate> | ||
|- | |- | ||
| {{anchor|Displaytitle}} <code><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></code> | | {{anchor|Displaytitle}} <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 are allowed (this can be changed with {{ | + | | <translate><!--T:93--> |
− | | 1.7 | + | Format the current page's title header. The value must be equivalent to the default title: only capitalization changes and replacing spaces with underscores are allowed (this can be changed with {{mediawiki|Special:MyLanguage/Manual:$wgRestrictDisplayTitle|$wgRestrictDisplayTitle}}). It can be disabled or enabled by {{mediawiki|Special:MyLanguage/Manual:$wgAllowDisplayTitle|$wgAllowDisplayTitle}}; disabled by default before 1.10+, enabled by default thereafter.</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| {{anchor|Defaultsort}} <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> <br/><code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>|noerror}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>|noreplace}}</nowiki></code> | | {{anchor|Defaultsort}} <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> <br/><code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>|noerror}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>|noreplace}}</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. It can take a second argument of ''noerror'' or ''noreplace'' to suppress error messages when multiple defaultsortkeys are used on one page or to make this <tt>defaultsort</tt> do nothing if a <tt>defaultsort</tt> was already specified earlier in the page. | + | | <translate><!--T:94--> |
− | | 1.10 | + | Used for categorizing pages, sets a default [[Special:MyLanguage/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. It can take a second argument of ''noerror'' or ''noreplace'' to suppress error messages when multiple defaultsortkeys are used on one page or to make this <tt>defaultsort</tt> do nothing if a <tt>defaultsort</tt> was already specified earlier in the page.</translate> |
+ | | {{MW version|version=1.10|compact=y|comment=and after}}<br/>{{MW version|version=1.19|compact=y|comment=and after|r=96767}} <br /> (<translate><!--T:95--> | ||
+ | for noerror and noreplace</translate>) | ||
|} | |} | ||
− | === Statistics === | + | <translate> |
+ | === Statistics === <!--T:96--> | ||
+ | |||
+ | <!--T:97--> | ||
+ | Numbers returned by these variables normally contain separators (commas, dots or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code> → {{NUMBEROFPAGES}} and <code><nowiki>{{NUMBEROFPAGES:R}}</nowiki></code> → {{NUMBEROFPAGES:R}}). | ||
− | + | <!--T:98--> | |
+ | 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>, or <code><nowiki>{{PAGESINCATEGORY:Help|subcats}}</nowiki></code> and <code><nowiki>{{PAGESINCATEGORY:Help|subcats|R}}</nowiki></code>). Also applicable to <code><nowiki>{{PAGESIZE:</nowiki>''page name''<nowiki>}}</nowiki></code> hereinbefore. | ||
− | The number magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, it depends on the [[page content language]]. | + | <!--T:99--> |
+ | The number magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, it depends on the [[Special:MyLanguage/page content language|page content language]]. | ||
+ | </translate> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Variable | + | ! <translate><!--T:100--> |
− | ! Output | + | Variable</translate> |
− | ! Description | + | ! <translate><!--T:101--> |
− | ! Versions | + | Output</translate> |
+ | ! <translate><!--T:102--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:103--> | ||
+ | Versions</translate> | ||
|- | |- | ||
| <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code> | | <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code> | ||
| {{NUMBEROFPAGES}} | | {{NUMBEROFPAGES}} | ||
− | | Number of wiki pages. | + | | <translate><!--T:104--> |
− | | 1.7 | + | Number of wiki pages.</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code> | | <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code> | ||
| {{NUMBEROFARTICLES}} | | {{NUMBEROFARTICLES}} | ||
− | | Number of pages in {{mediawiki|Manual:Using custom namespaces#Content namespaces|content namespaces}}. | + | | <translate><!--T:105--> |
+ | Number of pages in {{mediawiki|Special:MyLanguage/Manual:Using custom namespaces#Content namespaces|content namespaces}}.</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{NUMBEROFFILES}}</nowiki></code> | | <code><nowiki>{{NUMBEROFFILES}}</nowiki></code> | ||
| {{NUMBEROFFILES}} | | {{NUMBEROFFILES}} | ||
− | | Number of uploaded files. | + | | <translate><!--T:106--> |
− | | 1.5 | + | Number of uploaded files.</translate> |
+ | | {{MW version|version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{NUMBEROFEDITS}}</nowiki></code> | | <code><nowiki>{{NUMBEROFEDITS}}</nowiki></code> | ||
| {{NUMBEROFEDITS}} | | {{NUMBEROFEDITS}} | ||
− | | Number of wiki edits. | + | | <translate><!--T:107--> |
− | | {{ | + | Number of wiki edits.</translate> |
+ | | {{MW version|version=1.10|compact=y|comment=and after|r=21319}} | ||
|- | |- | ||
| <code><nowiki>{{NUMBEROFVIEWS}}</nowiki></code> | | <code><nowiki>{{NUMBEROFVIEWS}}</nowiki></code> | ||
| {{NUMBEROFVIEWS}} | | {{NUMBEROFVIEWS}} | ||
− | | Number of page views. Usually useless on a wiki using [[Manual:Cache|caching]]. | + | | <translate><!--T:108--> |
− | | {{ | + | Number of page views. Usually useless on a wiki using [[Special:MyLanguage/Manual:Cache|caching]].</translate> |
+ | | {{MW version|version=1.14|compact=y|comment=and after|r=42721}} | ||
|- | |- | ||
| <code><nowiki>{{NUMBEROFUSERS}}</nowiki></code> | | <code><nowiki>{{NUMBEROFUSERS}}</nowiki></code> | ||
| {{NUMBEROFUSERS}} | | {{NUMBEROFUSERS}} | ||
− | | Number of registered users. | + | | <translate><!--T:109--> |
− | | 1.7 | + | Number of registered users.</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{NUMBEROFADMINS}}</nowiki></code> | | <code><nowiki>{{NUMBEROFADMINS}}</nowiki></code> | ||
| {{NUMBEROFADMINS}} | | {{NUMBEROFADMINS}} | ||
− | | Number of users in the ''sysop'' {{mediawiki|Manual:User rights|group}}. | + | | <translate><!--T:110--> |
− | | 1.7 | + | Number of users in the ''sysop'' {{mediawiki|Special:MyLanguage/Manual:User rights|group}}.</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{NUMBEROFACTIVEUSERS}}</nowiki></code> | | <code><nowiki>{{NUMBEROFACTIVEUSERS}}</nowiki></code> | ||
| {{NUMBEROFACTIVEUSERS}} | | {{NUMBEROFACTIVEUSERS}} | ||
− | | Number of active users, based on the criteria used in [[Special:Statistics]]. | + | | <translate><!--T:111--> |
− | | {{ | + | Number of active users, based on the criteria used in [[Special:Statistics]].</translate> |
+ | | {{MW version|version=1.15|compact=y|comment=and after|r=47392}} | ||
|- style="background:#FED;" | |- style="background:#FED;" | ||
| <code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINCAT:</nowiki>''categoryname''<nowiki>}}</nowiki></code> | | <code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINCAT:</nowiki>''categoryname''<nowiki>}}</nowiki></code> | ||
| {{PAGESINCATEGORY:Help}} <br />{{PAGESINCAT:Help}} | | {{PAGESINCATEGORY:Help}} <br />{{PAGESINCAT:Help}} | ||
− | | '''[Expensive]''' Number of pages (including | + | | <translate><!--T:112--> |
− | | {{ | + | '''[Expensive]''' Number of pages (including subcategories and files) in the given [[Special:MyLanguage/Help:Categories|category]].</translate> |
+ | | {{MW version|version=1.13|compact=y|comment=and after|r=32932}} | ||
|- style="background:#FED;" | |- style="background:#FED;" | ||
| <code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|all}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|pages}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|subcats}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|files}}</nowiki></code> | | <code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|all}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|pages}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|subcats}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>|files}}</nowiki></code> | ||
| {{PAGESINCATEGORY:Help|all}} <br />{{PAGESINCATEGORY:Help|pages}} <br />{{PAGESINCATEGORY:Help|subcats}} <br />{{PAGESINCATEGORY:Help|files}} | | {{PAGESINCATEGORY:Help|all}} <br />{{PAGESINCATEGORY:Help|pages}} <br />{{PAGESINCATEGORY:Help|subcats}} <br />{{PAGESINCATEGORY:Help|files}} | ||
− | | '''[Expensive]''' Respectively, the number of | + | | <translate><!--T:113--> |
+ | '''[Expensive]''' Respectively, the number of | ||
* all pages | * all pages | ||
* ordinary pages (excluding subcategories and files) | * ordinary pages (excluding subcategories and files) | ||
* subcategories or | * subcategories or | ||
* files | * files | ||
− | in the given [[Help:Categories|category]]. | + | in the given [[Special:MyLanguage/Help:Categories|category]].</translate> |
− | | [ | + | | {{MW version|version=1.20|compact=y|comment=and after}}<br />[[gerrit:12790]] |
|- | |- | ||
| <code><nowiki>{{NUMBERINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{NUMINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code> | | <code><nowiki>{{NUMBERINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{NUMINGROUP:</nowiki>''groupname''<nowiki>}}</nowiki></code> | ||
| {{NUMBERINGROUP:bureaucrat}} <br />{{NUMINGROUP:bureaucrat}} <br /><small><nowiki>({{NUMBERINGROUP:bureaucrat}} used here)</nowiki></small> | | {{NUMBERINGROUP:bureaucrat}} <br />{{NUMINGROUP:bureaucrat}} <br /><small><nowiki>({{NUMBERINGROUP:bureaucrat}} used here)</nowiki></small> | ||
− | | Number of users in a specific {{mediawiki|Manual:User rights|group}}. | + | | <translate><!--T:114--> |
− | | {{ | + | Number of users in a specific {{mediawiki|Special:MyLanguage/Manual:User rights|group}}.</translate> |
+ | | {{MW version|version=1.14|compact=y|comment=and after|r=40116}} | ||
|- style="background:#FED;" | |- style="background:#FED;" | ||
| <code><nowiki>{{PAGESINNS:</nowiki>''index''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINNAMESPACE:</nowiki>''index''<nowiki>}}</nowiki></code> | | <code><nowiki>{{PAGESINNS:</nowiki>''index''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINNAMESPACE:</nowiki>''index''<nowiki>}}</nowiki></code> | ||
− | | ''Not enabled'' | + | | <translate><!--T:115--> |
− | | '''[Expensive]''' 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}}. | + | ''Not enabled''</translate> |
− | | 1.7 | + | | <translate><!--T:116--> |
+ | '''[Expensive]''' Number of pages in the given [[Special:MyLanguage/Help:Namespaces|namespace]] (replace ''index'' with the relevant [[Special:MyLanguage/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|Special:MyLanguage/Manual:$wgAllowSlowParserFunctions|$wgAllowSlowParserFunctions}}. </translate> | ||
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|} | |} | ||
− | === Page names === | + | {{Anchor|Page-names}} |
+ | <translate> | ||
+ | |||
+ | === Page names === <!--T:117--> | ||
+ | </translate> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Variable | + | ! <translate><!--T:118--> |
− | ! Output | + | Variable</translate> |
− | ! Description | + | ! <translate><!--T:119--> |
− | ! Versions | + | Output</translate> |
+ | ! <translate><!--T:120--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:121--> | ||
+ | Versions</translate> | ||
|- | |- | ||
| {{Anchor|FULLPAGENAME|fullpagename}}<code><nowiki>{{FULLPAGENAME}}</nowiki></code> | | {{Anchor|FULLPAGENAME|fullpagename}}<code><nowiki>{{FULLPAGENAME}}</nowiki></code> | ||
| {{FULLPAGENAME}} | | {{FULLPAGENAME}} | ||
− | | Namespace and full page title (including all subpage levels). | + | | <translate><!--T:122--> |
− | | 1.6 | + | Namespace and full page title (including all subpage levels).</translate> |
+ | | {{MW version|version=1.6|compact=y|comment=and after}} | ||
|- | |- | ||
| {{Anchor|PAGENAME|pagename}}<code><nowiki>{{PAGENAME}}</nowiki></code> | | {{Anchor|PAGENAME|pagename}}<code><nowiki>{{PAGENAME}}</nowiki></code> | ||
| {{PAGENAME}} | | {{PAGENAME}} | ||
− | | Full page title (including all subpage levels) without the namespace. | + | | <translate><!--T:123--> |
+ | Full page title (including all subpage levels) without the namespace.</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{BASEPAGENAME}}</nowiki></code> | | <code><nowiki>{{BASEPAGENAME}}</nowiki></code> | ||
| {{BASEPAGENAME}} | | {{BASEPAGENAME}} | ||
− | | {{Anchor|BASEPAGENAME|basepagename}}Page title of the page in the immediately superior [[Help:Subpages|subpage]] level without the namespace ("Title/foo" on "Help:Title/foo/bar"). | + | | {{Anchor|BASEPAGENAME|basepagename}}<translate><!--T:124--> |
− | For more complex splitting, use <code><nowiki>{{</nowiki>[[Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> from the [[Help:Extension:ParserFunctions|ParserFunctions extension]]. | + | Page title of the page in the immediately superior [[Special:MyLanguage/Help:Subpages|subpage]] level without the namespace ("Title/foo" on "Help:Title/foo/bar"). |
− | | 1.7 | + | |
+ | <!--T:260--> | ||
+ | For more complex splitting, use <code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code> from the [[Special:MyLanguage/Help:Extension:ParserFunctions|ParserFunctions extension]].</translate> | ||
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| {{Anchor|SUBPAGENAME|subpagename}}<code><nowiki>{{SUBPAGENAME}}</nowiki></code> | | {{Anchor|SUBPAGENAME|subpagename}}<code><nowiki>{{SUBPAGENAME}}</nowiki></code> | ||
| {{SUBPAGENAME}} | | {{SUBPAGENAME}} | ||
− | | The [[Help:Subpages|subpage]] title ("bar" on "Help:Title/foo/bar"). | + | | <translate><!--T:125--> |
− | | 1.6 | + | The [[Special:MyLanguage/Help:Subpages|subpage]] title ("bar" on "Help:Title/foo/bar").</translate> |
+ | | {{MW version|version=1.6|compact=y|comment=and after}} | ||
|- | |- | ||
| {{Anchor|SUBJECTPAGENAME|ARTICLEPAGENAME|subjectpagename|articlepagename}}<code><nowiki>{{SUBJECTPAGENAME}}</nowiki></code> <br/><code><nowiki>{{ARTICLEPAGENAME}}</nowiki></code> | | {{Anchor|SUBJECTPAGENAME|ARTICLEPAGENAME|subjectpagename|articlepagename}}<code><nowiki>{{SUBJECTPAGENAME}}</nowiki></code> <br/><code><nowiki>{{ARTICLEPAGENAME}}</nowiki></code> | ||
| {{SUBJECTPAGENAME}}<br/>{{ARTICLEPAGENAME}} | | {{SUBJECTPAGENAME}}<br/>{{ARTICLEPAGENAME}} | ||
− | | Full page name of the associated subject (e.g. article or file). Useful on talk pages. | + | | <translate><!--T:126--> |
− | | 1.7 | + | Full page name of the associated subject (e.g. article or file). Useful on talk pages.</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| {{Anchor|TALKPAGENAME|talkpagename}}<code><nowiki>{{TALKPAGENAME}}</nowiki></code> | | {{Anchor|TALKPAGENAME|talkpagename}}<code><nowiki>{{TALKPAGENAME}}</nowiki></code> | ||
| {{TALKPAGENAME}} | | {{TALKPAGENAME}} | ||
− | | Full page name of the associated talk page. | + | | <translate><!--T:127--> |
− | | 1.7 | + | Full page name of the associated talk page.</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|} | |} | ||
− | 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. | + | <translate> |
+ | <!--T:128--> | ||
+ | The <code><nowiki>{{BASEPAGENAME}}</nowiki></code> and <code><nowiki>{{SUBPAGENAME}}</nowiki></code> magic words only work in namespaces that have subpages enabled. See {{mediawiki|Special:MyLanguage/Manual:$wgNamespacesWithSubpages|$wgNamespacesWithSubpages}} for information on enabling subpages. | ||
+ | <!--T:129--> | ||
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: | 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> → '''{{PAGENAME:Template:Main Page}}''' | * <code><nowiki>{{PAGENAME:Template:Main Page}}</nowiki></code> → '''{{PAGENAME:Template:Main Page}}''' | ||
+ | <!--T:130--> | ||
{{Warning|Page titles containing certain characters, such as apostrophes <code>'</code> 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}} and {{mediawiki|bugzilla:35628|35628}}. One simple way to fix this is wrapping the pagename in #titleparts (parser function).}} | {{Warning|Page titles containing certain characters, such as apostrophes <code>'</code> 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}} and {{mediawiki|bugzilla:35628|35628}}. One simple way to fix this is wrapping the pagename in #titleparts (parser function).}} | ||
+ | <!--T:131--> | ||
For example, if page name is "L'Aquila", the following code will produce the string "Numeric char encoding": | For example, if page name is "L'Aquila", the following code will produce the string "Numeric char encoding": | ||
+ | <!--T:132--> | ||
<pre><nowiki>{{#switch:{{PAGENAME}} | <pre><nowiki>{{#switch:{{PAGENAME}} | ||
| L'Aquila = No translation | | L'Aquila = No translation | ||
468行目: | 623行目: | ||
}}</nowiki></pre> | }}</nowiki></pre> | ||
− | ==== URL encoded page names ==== | + | ==== URL encoded page names ==== <!--T:133--> |
+ | <!--T:134--> | ||
The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters [[wikipedia:Numeric character reference|HTML escaped using numeric character encoding]]): | The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters [[wikipedia:Numeric character reference|HTML escaped using numeric character encoding]]): | ||
+ | </translate> | ||
+ | |||
* <code><nowiki>{{FULLPAGENAMEE}}</nowiki> | * <code><nowiki>{{FULLPAGENAMEE}}</nowiki> | ||
* <nowiki>{{PAGENAMEE}}</nowiki> | * <nowiki>{{PAGENAMEE}}</nowiki> | ||
479行目: | 637行目: | ||
* <nowiki>{{TALKPAGENAMEE}}</nowiki></code> | * <nowiki>{{TALKPAGENAMEE}}</nowiki></code> | ||
− | 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. | + | <translate> |
+ | <!--T:135--> | ||
+ | Note that <code><nowiki>{{PAGENAME}}</nowiki></code>, <code><nowiki>{{PAGENAMEE}}</nowiki></code> and <code><nowiki>{{urlencode:}}</nowiki></code> have distinct implementations. See [[Special:MyLanguage/Manual:PAGENAMEE encoding|Manual:PAGENAMEE encoding]] for details. | ||
− | === Namespaces === | + | === Namespaces === <!--T:136--> |
+ | </translate> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Variable | + | ! <translate><!--T:137--> |
− | ! Output | + | Variable</translate> |
− | ! Description | + | ! <translate><!--T:138--> |
− | ! Versions | + | Output</translate> |
+ | ! <translate><!--T:139--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:140--> | ||
+ | Versions</translate> | ||
|- | |- | ||
| <code><nowiki>{{NAMESPACE}}</nowiki></code> | | <code><nowiki>{{NAMESPACE}}</nowiki></code> | ||
| {{NAMESPACE}} | | {{NAMESPACE}} | ||
− | | Name of the page's namespace | + | | <translate><!--T:141--> |
+ | Name of the page's namespace</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{NAMESPACENUMBER}}</nowiki></code> | | <code><nowiki>{{NAMESPACENUMBER}}</nowiki></code> | ||
| {{NAMESPACENUMBER}} | | {{NAMESPACENUMBER}} | ||
− | | [[Manual:Namespace#Built-in_namespaces|ID]] of the page's namespace | + | | <translate><!--T:142--> |
− | | [[gerrit:4056 | + | [[Special:MyLanguage/Manual:Namespace#Built-in_namespaces|ID]] of the page's namespace</translate> |
+ | | {{MW version|version=1.20|compact=y|comment=and after}}<br />[[gerrit:4056]] | ||
|- | |- | ||
| <code><nowiki>{{SUBJECTSPACE}}</nowiki></code> <br /><code><nowiki>{{ARTICLESPACE}}</nowiki></code> | | <code><nowiki>{{SUBJECTSPACE}}</nowiki></code> <br /><code><nowiki>{{ARTICLESPACE}}</nowiki></code> | ||
| {{SUBJECTSPACE}} <br />{{ARTICLESPACE}} | | {{SUBJECTSPACE}} <br />{{ARTICLESPACE}} | ||
− | | Name of the associated content namespace | + | | <translate><!--T:143--> |
− | | 1.7 | + | Name of the associated content namespace</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{TALKSPACE}}</nowiki></code> | | <code><nowiki>{{TALKSPACE}}</nowiki></code> | ||
| {{TALKSPACE}} | | {{TALKSPACE}} | ||
− | | Name of the associated talk namespace | + | | <translate><!--T:144--> |
− | | 1.7 | + | Name of the associated talk namespace</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|} | |} | ||
+ | <translate> | ||
+ | <!--T:145--> | ||
The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded): | The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded): | ||
+ | </translate> | ||
+ | |||
* <code><nowiki>{{NAMESPACEE}}</nowiki> | * <code><nowiki>{{NAMESPACEE}}</nowiki> | ||
* <nowiki>{{SUBJECTSPACEE}}</nowiki> | * <nowiki>{{SUBJECTSPACEE}}</nowiki> | ||
* <nowiki>{{TALKSPACEE}}</nowiki></code> | * <nowiki>{{TALKSPACEE}}</nowiki></code> | ||
+ | <translate> | ||
+ | <!--T:146--> | ||
As of {{mediawiki|rev:46630|1.15+}}, these can take a full-page-name parameter and will return the requested namespace associated with that page, instead of with the current page: | As of {{mediawiki|rev:46630|1.15+}}, these can take a full-page-name parameter and will return the requested namespace associated with that page, instead of with the current page: | ||
+ | </translate> | ||
+ | |||
* <code><nowiki>{{NAMESPACE:Template:Main Page}}</nowiki></code> → '''{{NAMESPACE:Template:Main Page}}''' | * <code><nowiki>{{NAMESPACE:Template:Main Page}}</nowiki></code> → '''{{NAMESPACE:Template:Main Page}}''' | ||
* <code><nowiki>{{SUBJECTSPACE:Template:Main Page}}</nowiki></code> → '''{{SUBJECTSPACE:Template:Main Page}}''' | * <code><nowiki>{{SUBJECTSPACE:Template:Main Page}}</nowiki></code> → '''{{SUBJECTSPACE:Template:Main Page}}''' | ||
* <code><nowiki>{{TALKSPACE:Template:Main Page}}</nowiki></code> → '''{{TALKSPACE:Template:Main Page}}''' | * <code><nowiki>{{TALKSPACE:Template:Main Page}}</nowiki></code> → '''{{TALKSPACE:Template:Main Page}}''' | ||
+ | <translate> | ||
+ | <!--T:147--> | ||
Parameter must not be a namespace name: | Parameter must not be a namespace name: | ||
+ | </translate> | ||
* <code><nowiki>{{SUBJECTSPACE:Help talk}}</nowiki></code> → '''{{SUBJECTSPACE:Help talk}}<!-- empty --> ''' (''Empty'') | * <code><nowiki>{{SUBJECTSPACE:Help talk}}</nowiki></code> → '''{{SUBJECTSPACE:Help talk}}<!-- empty --> ''' (''Empty'') | ||
− | == Parser functions == | + | <translate> |
+ | == Parser functions == <!--T:148--> | ||
+ | <!--T:149--> | ||
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. | 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 {{mediawiki|Extension:ParserFunctions|ParserFunctions extension}}. For those see [[Help:Extension:ParserFunctions]]. | + | <!--T:150--> |
+ | 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|Special:MyLanguage/Extension:ParserFunctions|ParserFunctions extension}}. For those see [[Special:MyLanguage/Help:Extension:ParserFunctions|Help:Extension:ParserFunctions]]. | ||
+ | |||
+ | === Technical metadata of another page === <!--T:151--> | ||
+ | </translate> | ||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Parser function | + | ! <translate><!--T:152--> |
− | ! Output<br />(for page [[MediaWiki]]) | + | Parser function</translate> |
− | ! Description | + | ! <translate><!--T:153--> |
− | ! Versions | + | Output<br />(for page [[MediaWiki]])</translate> |
+ | ! <translate><!--T:154--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:155--> | ||
+ | Versions</translate> | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{PAGEID: </nowiki>''page name''<nowiki> }}</nowiki></code> | | <code><nowiki>{{PAGEID: </nowiki>''page name''<nowiki> }}</nowiki></code> | ||
| {{PAGEID: MediaWiki }} | | {{PAGEID: MediaWiki }} | ||
− | | [Expensive] Returns the page identifier of the specified page*. | + | | <translate><!--T:156--> |
− | | {{ | + | [Expensive] Returns the page identifier of the specified page*.</translate> |
+ | | {{MW version|version=1.23|compact=y|comment=and after}}<br /> [[gerrit:76534]] | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{PAGESIZE: </nowiki>''page name''<nowiki> }}</nowiki></code> <br /><code><nowiki>{{PAGESIZE: </nowiki>''page name''<nowiki> |R}}</nowiki> | | <code><nowiki>{{PAGESIZE: </nowiki>''page name''<nowiki> }}</nowiki></code> <br /><code><nowiki>{{PAGESIZE: </nowiki>''page name''<nowiki> |R}}</nowiki> | ||
| {{PAGESIZE: MediaWiki }} <br />{{PAGESIZE: MediaWiki |R}} | | {{PAGESIZE: MediaWiki }} <br />{{PAGESIZE: MediaWiki |R}} | ||
− | | [Expensive] Returns the byte size of the specified page. Use "<code><nowiki>|R</nowiki></code>" to get raw (unformatted) numbers. | + | | <translate><!--T:157--> |
− | | {{ | + | [Expensive] Returns the byte size of the specified page. Use "<code><nowiki>|R</nowiki></code>" to get raw (unformatted) numbers.</translate> |
+ | | {{MW version|version=1.13|compact=y|comment=and after|r=33551}} | ||
|- | |- | ||
| <code><nowiki>{{</nowiki>PROTECTIONLEVEL: ''action'' | ''page name'' }}</code> | | <code><nowiki>{{</nowiki>PROTECTIONLEVEL: ''action'' | ''page name'' }}</code> | ||
| {{PROTECTIONLEVEL: edit | MediaWiki }} | | {{PROTECTIONLEVEL: edit | MediaWiki }} | ||
− | | Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the specified page. Returns an empty string if not protected. | + | | <translate><!--T:158--> |
− | | {{ | + | Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the specified page. Returns an empty string if not protected.</translate> |
+ | | {{MW version|version=1.21|compact=y|comment=and after|r=44683}} | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{REVISIONID: </nowiki>''page name''<nowiki> }}</nowiki></code> | | <code><nowiki>{{REVISIONID: </nowiki>''page name''<nowiki> }}</nowiki></code> | ||
| {{REVISIONID: MediaWiki }} | | {{REVISIONID: MediaWiki }} | ||
− | | [Expensive] Unique revision ID of the last revision on the specified page*. | + | | <translate><!--T:160--> |
− | | {{ | + | [Expensive] Unique revision ID of the last revision on the specified page*.</translate> |
+ | | {{MW version|version=1.23|compact=y|comment=and after}}<br /> [[mediawiki|gerrit:76534]] | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{REVISIONDAY: </nowiki>''page name''<nowiki> }}</nowiki></code> | | <code><nowiki>{{REVISIONDAY: </nowiki>''page name''<nowiki> }}</nowiki></code> | ||
| {{REVISIONDAY: MediaWiki }} | | {{REVISIONDAY: MediaWiki }} | ||
− | | [Expensive] Day of edit from the last revision of the specified page* (unpadded number). | + | | <translate><!--T:161--> |
− | | {{ | + | [Expensive] Day of edit from the last revision of the specified page* (unpadded number).</translate> |
+ | | {{MW version|version=1.23|compact=y|comment=and after}}<br /> [[gerrit:76534]] | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{REVISIONDAY2: </nowiki>''page name''<nowiki> }}</nowiki></code> | | <code><nowiki>{{REVISIONDAY2: </nowiki>''page name''<nowiki> }}</nowiki></code> | ||
| {{REVISIONDAY2: MediaWiki }} | | {{REVISIONDAY2: MediaWiki }} | ||
− | | [Expensive] Day of edit from the last revision of the specified page* (zero-padded number). | + | | <translate><!--T:162--> |
− | | {{ | + | [Expensive] Day of edit from the last revision of the specified page* (zero-padded number).</translate> |
+ | | {{MW version|version=1.23|compact=y|comment=and after}}<br /> [[gerrit:76534]] | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{REVISIONMONTH: </nowiki>''page name''<nowiki> }}</nowiki></code> | | <code><nowiki>{{REVISIONMONTH: </nowiki>''page name''<nowiki> }}</nowiki></code> | ||
| {{REVISIONMONTH: MediaWiki }} | | {{REVISIONMONTH: MediaWiki }} | ||
− | | [Expensive] Month of edit from the last revision of the specified page* (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions). | + | | <translate><!--T:163--> |
− | | {{ | + | [Expensive] Month of edit from the last revision of the specified page* (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions).</translate> |
+ | | {{MW version|version=1.23|compact=y|comment=and after}}<br /> [[gerrit:76534]] | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{REVISIONMONTH1: </nowiki>''page name''<nowiki> }}</nowiki></code> | | <code><nowiki>{{REVISIONMONTH1: </nowiki>''page name''<nowiki> }}</nowiki></code> | ||
| {{REVISIONMONTH1: MediaWiki }} | | {{REVISIONMONTH1: MediaWiki }} | ||
− | | [Expensive] Month of edit from the last revision of the specified page* (unpadded number). | + | | <translate><!--T:164--> |
− | | {{ | + | [Expensive] Month of edit from the last revision of the specified page* (unpadded number).</translate> |
+ | | {{MW version|version=1.23|compact=y|comment=and after}}<br /> [[gerrit:76534]] | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{REVISIONYEAR: </nowiki>''page name''<nowiki> }}</nowiki></code> | | <code><nowiki>{{REVISIONYEAR: </nowiki>''page name''<nowiki> }}</nowiki></code> | ||
| {{REVISIONYEAR: MediaWiki }} | | {{REVISIONYEAR: MediaWiki }} | ||
− | | [Expensive] Year of edit from the last revision of the specified page*. | + | | <translate><!--T:165--> |
− | | {{ | + | [Expensive] Year of edit from the last revision of the specified page*.</translate> |
+ | | {{MW version|version=1.23|compact=y|comment=and after}}<br /> [[gerrit:76534]] | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{REVISIONTIMESTAMP: </nowiki>''page name''<nowiki> }}</nowiki></code> | | <code><nowiki>{{REVISIONTIMESTAMP: </nowiki>''page name''<nowiki> }}</nowiki></code> | ||
| {{REVISIONTIMESTAMP: MediaWiki }} | | {{REVISIONTIMESTAMP: MediaWiki }} | ||
− | | [Expensive] Timestamp as of time of edit on the specified page*. | + | | <translate><!--T:166--> |
− | | {{ | + | [Expensive] Timestamp as of time of edit on the specified page*.</translate> |
+ | | {{MW version|version=1.23|compact=y|comment=and after}}<br /> [[gerrit:76534]] | ||
|- style="background: #FED;" | |- style="background: #FED;" | ||
| <code><nowiki>{{REVISIONUSER: </nowiki>''page name''<nowiki> }}</nowiki></code> | | <code><nowiki>{{REVISIONUSER: </nowiki>''page name''<nowiki> }}</nowiki></code> | ||
| {{REVISIONUSER: MediaWiki }} | | {{REVISIONUSER: MediaWiki }} | ||
− | | [Expensive] The username from the last revision on the specified page*. | + | | <translate><!--T:167--> |
− | | {{ | + | [Expensive] The username from the last revision on the specified page*.</translate> |
+ | | {{MW version|version=1.23|compact=y|comment=and after}}<br /> [[gerrit:76534]] | ||
|- | |- | ||
− | | colspan="4" | *When the given param is equal to the current title of the parser, the parser function will yield the previous versions on preview and on substitution, that includes empty strings when used on page creation, but using the values from the current version for page view, including viewing old revisions. In this case it is a non-expensive parser function. | + | | colspan="4" | <translate><!--T:168--> |
+ | *When the given param is equal to the current title of the parser, the parser function will yield the previous versions on preview and on substitution, that includes empty strings when used on page creation, but using the values from the current version for page view, including viewing old revisions. In this case it is a non-expensive parser function.</translate> | ||
|} | |} | ||
− | === URL data === | + | <translate> |
+ | === URL data === <!--T:169--> | ||
+ | </translate> | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! Parser function | + | ! <translate><!--T:170--> |
− | ! Input → Output | + | Parser function</translate> |
− | ! Description | + | ! <translate><!--T:171--> |
− | ! Versions | + | Input → Output</translate> |
+ | ! <translate><!--T:172--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:173--> | ||
+ | Versions</translate> | ||
|- | |- | ||
| colspan="4"| {{Anchor|localurl|LOCALURL}} | | colspan="4"| {{Anchor|localurl|LOCALURL}} | ||
608行目: | 815行目: | ||
| <code><nowiki>{{localurl:</nowiki>''page name''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{localurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code> | | <code><nowiki>{{localurl:</nowiki>''page name''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{localurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></code> | ||
| <code><nowiki>{{localurl:MediaWiki}}</nowiki></code> → {{localurl:MediaWiki}} <br /><code><nowiki>{{localurl:MediaWiki|printable=yes}}</nowiki></code> → {{localurl:MediaWiki|printable=yes}} | | <code><nowiki>{{localurl:MediaWiki}}</nowiki></code> → {{localurl:MediaWiki}} <br /><code><nowiki>{{localurl:MediaWiki|printable=yes}}</nowiki></code> → {{localurl:MediaWiki|printable=yes}} | ||
− | | The relative path to the title. | + | | <translate><!--T:174--> |
+ | The relative path to the title. </translate> | ||
| | | | ||
|- | |- | ||
616行目: | 824行目: | ||
| <code><nowiki>{{fullurl:Category:Top level}}</nowiki></code> → {{fullurl:Category:Top level}} <br /> | | <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}} | <code><nowiki>{{fullurl:Category:Top level|action=edit}}</nowiki></code> → {{fullurl:Category:Top level|action=edit}} | ||
− | | A protocol-relative path to the title. This will also resolve [[Manual:Interwiki|interwiki]] prefixes. '''Note:''' Unbracketed (plain) protocol-relative links are not automagically linked. | + | | <translate><!--T:175--> |
− | | 1.5 | + | A protocol-relative path to the title. This will also resolve [[Special:MyLanguage/Manual:Interwiki|interwiki]] prefixes. '''Note:''' Unbracketed (plain) protocol-relative links are not automagically linked.</translate> |
+ | | {{MW version|version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
| colspan="4"| {{Anchor|canonicalurl|CANONICALURL}} | | colspan="4"| {{Anchor|canonicalurl|CANONICALURL}} | ||
624行目: | 833行目: | ||
| <code><nowiki>{{canonicalurl:Category:Top level}}</nowiki></code> → {{canonicalurl:Category:Top level}} <br /> | | <code><nowiki>{{canonicalurl:Category:Top level}}</nowiki></code> → {{canonicalurl:Category:Top level}} <br /> | ||
<code><nowiki>{{canonicalurl:Category:Top level|action=edit}}</nowiki></code> → {{canonicalurl:Category:Top level|action=edit}} | <code><nowiki>{{canonicalurl:Category:Top level|action=edit}}</nowiki></code> → {{canonicalurl:Category:Top level|action=edit}} | ||
− | | The absolute path to the title, using the canonical URL. This will also resolve [[Manual:Interwiki|interwiki]] prefixes. | + | | <translate><!--T:176--> |
− | | 1.18 | + | The absolute path to the title, using the canonical URL. This will also resolve [[Special:MyLanguage/Manual:Interwiki|interwiki]] prefixes.</translate> |
+ | | {{MW version|version=1.18|compact=y|comment=and after}} | ||
|- | |- | ||
| colspan="4"| {{Anchor|filepath|FILEPATH}} | | colspan="4"| {{Anchor|filepath|FILEPATH}} | ||
633行目: | 843行目: | ||
<code><nowiki>{{filepath:Wiki.png|nowiki}}</nowiki></code> → {{filepath:Wiki.png|nowiki}} <br /> | <code><nowiki>{{filepath:Wiki.png|nowiki}}</nowiki></code> → {{filepath:Wiki.png|nowiki}} <br /> | ||
<code><nowiki>{{filepath:Example.svg|300}}</nowiki></code> → {{filepath:Example.svg|300}} <br /> | <code><nowiki>{{filepath:Example.svg|300}}</nowiki></code> → {{filepath:Example.svg|300}} <br /> | ||
− | | A protocol-relative path to the full size or thumbnail ({{mediawiki|rev:80813|1.18+}}) of a media file. | + | | <translate><!--T:177--> |
− | | {{ | + | A protocol-relative path to the full size or thumbnail ({{mediawiki|rev:80813|1.18+}}) of a media file.</translate> |
+ | | {{MW version|version=1.12|compact=y|comment=and after|r=25854}} <br />{{MW version|version=1.18|compact=y|comment=and after|r=80813}} | ||
|- | |- | ||
| colspan="4"| {{Anchor|urlencode|URLENCODE}} | | colspan="4"| {{Anchor|urlencode|URLENCODE}} | ||
|- | |- | ||
| <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> | | <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> | ||
− | | <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> → | + | | <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> → {{urlencode:x:y/z á é|WIKI}} <br /><code><nowiki>{{urlencode:x:y/z á é|PATH}}</nowiki></code> → {{urlencode:x:y/z á é|PATH}} |
− | 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. | + | <translate><!--T:178--> |
− | | The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete [[Extension:StringFunctions]]. | + | 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.</translate> |
− | | {{ | + | | <translate><!--T:179--> |
+ | The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete [[Special:MyLanguage/Extension:StringFunctions|Extension:StringFunctions]].</translate> | ||
+ | | {{MW version|version=1.7|compact=y|comment=and after|r=14273}} (or {{MW version|version=1.17|compact=y|comment=and after|r=64726}} <br />{{MW version|version=1.17|compact=y|comment=and after|r=64726}} <br />{{MW version|version=1.17|compact=y|comment=and after|r=64726}}) | ||
|- | |- | ||
| colspan="4"| {{Anchor|anchorencode|ANCHORENCODE}} | | colspan="4"| {{Anchor|anchorencode|ANCHORENCODE}} | ||
648行目: | 861行目: | ||
| <code><nowiki>{{anchorencode:</nowiki>''string''<nowiki>}}</nowiki></code> | | <code><nowiki>{{anchorencode:</nowiki>''string''<nowiki>}}</nowiki></code> | ||
| <code><nowiki>{{anchorencode:x y z á é}}</nowiki></code> → {{anchorencode:x y z á é}} | | <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). | + | | <translate><!--T:180--> |
− | | {{ | + | The input encoded for use in URL section anchors (after the “#” symbol in a URL).</translate> |
+ | | {{MW version|version=1.6|compact=y|comment=and after|r=16279}} | ||
|} | |} | ||
− | + | <translate> | |
− | < | + | === Namespaces === <!--T:181--> |
+ | <!--T:182--> | ||
+ | <code><nowiki>{{ns:}}</nowiki></code> returns the current localized name for the [[Special:MyLanguage/Help:Namespace|namespace]] with that index, canonical name, or local alias. Thus <code><nowiki>{{ns:6}}</nowiki></code>, <code><nowiki>{{ns:File}}</nowiki></code>, and <code><nowiki>{{ns:Image}}</nowiki></code> (an old name for the File namespace) all return "{{ns:6}}". On a wiki where the content language is French, <code><nowiki>{{ns:Fichier}}</nowiki></code> is also valid, but <code><nowiki>{{ns:Datei}}</nowiki></code> (the localisation of "File" in German) is not. | ||
+ | |||
+ | <!--T:183--> | ||
<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. | <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. | ||
+ | </translate> | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! colspan="2" width="50%" | Content namespaces | + | ! colspan="2" width="50%" | <translate><!--T:258--> |
+ | Content namespaces</translate> | ||
! rowspan="12" | | ! rowspan="12" | | ||
− | ! colspan="2" width=%50%" | Talk namespaces | + | ! colspan="2" width=%50%" | <translate><!--T:259--> |
+ | Talk namespaces</translate> | ||
|- | |- | ||
− | ! Usage | + | ! <translate><!--T:184--> |
− | ! Output | + | Usage</translate> |
− | ! Usage | + | ! <translate><!--T:185--> |
− | ! Output | + | Output</translate> |
+ | ! <translate><!--T:186--> | ||
+ | Usage</translate> | ||
+ | ! <translate><!--T:187--> | ||
+ | Output</translate> | ||
|- | |- | ||
− | | <code><nowiki>{{ns:-2}}</nowiki></code> | + | | <code><nowiki>{{ns:-2}}</nowiki></code> / <code><nowiki>{{ns:Media}}</nowiki></code> |
| {{ns:-2}} || || | | {{ns:-2}} || || | ||
|- | |- | ||
− | | <code><nowiki>{{ns:-1}}</nowiki></code> | + | | <code><nowiki>{{ns:-1}}</nowiki></code> / <code><nowiki>{{ns:Special}}</nowiki></code> |
| {{ns:-1}} || || | | {{ns:-1}} || || | ||
|- | |- | ||
− | | <code><nowiki>{{ns:0}}</nowiki></code> | + | | <code><nowiki>{{ns:0}}</nowiki></code> / <code><nowiki>{{ns:}}</nowiki></code> |
| {{ns:}} | | {{ns:}} | ||
− | | <code><nowiki>{{ns:1}}</nowiki></code> | + | | <code><nowiki>{{ns:1}}</nowiki></code> / <code><nowiki>{{ns:Talk}}</nowiki></code> |
| {{ns:1}} | | {{ns:1}} | ||
|- | |- | ||
− | | <code><nowiki>{{ns:2}}</nowiki></code> | + | | <code><nowiki>{{ns:2}}</nowiki></code> / <code><nowiki>{{ns:User}}</nowiki></code> |
| {{ns:2}} | | {{ns:2}} | ||
− | | <code><nowiki>{{ns:3}}</nowiki></code> | + | | <code><nowiki>{{ns:3}}</nowiki></code> / <code><nowiki>{{ns:User talk}}</nowiki></code> |
| {{ns:3}} | | {{ns:3}} | ||
|- | |- | ||
− | | <code><nowiki>{{ns:4}}</nowiki></code> | + | | <code><nowiki>{{ns:4}}</nowiki></code> / <code><nowiki>{{ns:Project}}</nowiki></code> |
| {{ns:4}} <br/>''Varies between wikis'' | | {{ns:4}} <br/>''Varies between wikis'' | ||
− | | <code><nowiki>{{ns:5}}</nowiki></code> | + | | <code><nowiki>{{ns:5}}</nowiki></code> / <code><nowiki>{{ns:Project talk}}</nowiki></code> |
| {{ns:5}} | | {{ns:5}} | ||
|- | |- | ||
− | | <code><nowiki>{{ns:6}}</nowiki></code> | + | | <code><nowiki>{{ns:6}}</nowiki></code> / <code><nowiki>{{ns:File}}</nowiki></code> or <code><nowiki>{{ns:Image}}</nowiki></code> |
| {{ns:6}} | | {{ns:6}} | ||
− | | <code><nowiki>{{ns:7}}</nowiki></code> | + | | <code><nowiki>{{ns:7}}</nowiki></code> / <code><nowiki>{{ns:File talk}}</nowiki></code> or <code><nowiki>{{ns:Image talk}}</nowiki></code> |
| {{ns:7}} | | {{ns:7}} | ||
|- | |- | ||
− | | <code><nowiki>{{ns:8}}</nowiki></code> | + | | <code><nowiki>{{ns:8}}</nowiki></code> / <code><nowiki>{{ns:MediaWiki}}</nowiki></code> |
| {{ns:8}} | | {{ns:8}} | ||
− | | <code><nowiki>{{ns:9}}</nowiki></code> | + | | <code><nowiki>{{ns:9}}</nowiki></code> / <code><nowiki>{{ns:MediaWiki talk}}</nowiki></code> |
| {{ns:9}} | | {{ns:9}} | ||
|- | |- | ||
− | | <code><nowiki>{{ns:10}}</nowiki></code> | + | | <code><nowiki>{{ns:10}}</nowiki></code> / <code><nowiki>{{ns:Template}}</nowiki></code> |
| {{ns:10}} | | {{ns:10}} | ||
− | | <code><nowiki>{{ns:11}}</nowiki></code> | + | | <code><nowiki>{{ns:11}}</nowiki></code> / <code><nowiki>{{ns:Template talk}}</nowiki></code> |
| {{ns:11}} | | {{ns:11}} | ||
|- | |- | ||
− | | <code><nowiki>{{ns:12}}</nowiki></code> | + | | <code><nowiki>{{ns:12}}</nowiki></code> / <code><nowiki>{{ns:Help}}</nowiki></code> |
| {{ns:12}} | | {{ns:12}} | ||
− | | <code><nowiki>{{ns:13}}</nowiki></code> | + | | <code><nowiki>{{ns:13}}</nowiki></code> / <code><nowiki>{{ns:Help talk}}</nowiki></code> |
| {{ns:13}} | | {{ns:13}} | ||
|- | |- | ||
− | | <code><nowiki>{{ns:14}}</nowiki></code> | + | | <code><nowiki>{{ns:14}}</nowiki></code> / <code><nowiki>{{ns:Category}}</nowiki></code> |
| {{ns:14}} | | {{ns:14}} | ||
− | | <code><nowiki>{{ns:15}}</nowiki></code> | + | | <code><nowiki>{{ns:15}}</nowiki></code> / <code><nowiki>{{ns:Category talk}}</nowiki></code> |
| {{ns:15}} | | {{ns:15}} | ||
|} | |} | ||
− | Don't confuse localised namespaces with [[Manual:Using custom namespaces|custom namespaces]]. | + | <translate> |
+ | <!--T:188--> | ||
+ | Don't confuse localised namespaces with [[Special:MyLanguage/Manual:Using custom namespaces|custom namespaces]]. | ||
− | === Formatting === | + | === Formatting === <!--T:189--> |
+ | </translate> | ||
<!-- Well gosh, with the source of the examples hidden, who can tell what you are inputting without looking here in the source? --> | <!-- Well gosh, with the source of the examples hidden, who can tell what you are inputting without looking here in the source? --> | ||
{| class="wikitable" | {| class="wikitable" | ||
− | ! Usage | + | ! <translate><!--T:190--> |
− | ! Input → Output | + | Usage</translate> |
− | ! Description | + | ! <translate><!--T:191--> |
− | ! Version | + | Input → Output</translate> |
+ | ! <translate><!--T:192--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:193--> | ||
+ | Version</translate> | ||
|- | |- | ||
| <code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>}}</nowiki></code> <br /> | | <code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>}}</nowiki></code> <br /> | ||
731行目: | 964行目: | ||
<code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>|NOSEP}}</nowiki></code> | <code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>|NOSEP}}</nowiki></code> | ||
| | | | ||
− | * Simple: | + | * <translate><!--T:194--> |
+ | Simple:</translate> | ||
** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → {{formatnum:987654321.654321}} <br /> | ** <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}} | ** <code><nowiki>{{formatnum:987,654,321.654321|R}}</nowiki></code> <br/> → {{formatnum:987,654,321.654321|R}} | ||
− | * Advanced: | + | * <translate><!--T:195--> |
− | ** <code><nowiki>{{formatnum:{{formatnum:987654321.654321}}|R}}</nowiki></code> <br/> → 987654321.654321 (on any locale) <br /> | + | Advanced:</translate> |
+ | ** <code><nowiki>{{formatnum:{{formatnum:987654321.654321}}|R}}</nowiki></code> <br/> → 987654321.654321 <translate><!--T:196--> | ||
+ | (on any locale)</translate> <br /> | ||
** <code><nowiki>{{formatnum:00001}}</nowiki></code> <br/> → {{formatnum:00001}} <br /> | ** <code><nowiki>{{formatnum:00001}}</nowiki></code> <br/> → {{formatnum:00001}} <br /> | ||
− | ** Examples with {{#language:hi|en}} locale: | + | ** <translate><!--T:197--> |
+ | Examples with {{#language:hi|en}} locale:</translate> | ||
*** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → 98,76,54,321.654321 | *** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → 98,76,54,321.654321 | ||
*** <code><nowiki>{{formatnum:987654321.654321 |NOSEP}}</nowiki></code> <br/> → 987654321.654321 | *** <code><nowiki>{{formatnum:987654321.654321 |NOSEP}}</nowiki></code> <br/> → 987654321.654321 | ||
743行目: | 980行目: | ||
---- | ---- | ||
− | Unsupported: <br /> | + | <translate><!--T:198--> |
− | <code><nowiki>{{formatnum:{{formatnum:987.654.321}}}}</nowiki></code> <br/> → 987 654 321 (e.g. with Italian locale) | + | Unsupported:</translate> <br /> |
+ | <code><nowiki>{{formatnum:{{formatnum:987.654.321}}}}</nowiki></code> <br/> → 987 654 321 <translate><!--T:199--> | ||
+ | (e.g. with Italian locale)</translate> | ||
---- | ---- | ||
− | Examples of wrong input (unreliable output), with or without <code>|R</code>: <br /> | + | <translate><!--T:200--> |
− | <code><nowiki>{{formatnum:987,654.321|R}}</nowiki></code> (the least broken) <br/> | + | Examples of wrong input (unreliable output), with or without <code>|R</code>:</translate> <br /> |
+ | <code><nowiki>{{formatnum:987,654.321|R}}</nowiki></code> <translate><!--T:201--> | ||
+ | (the least broken)</translate> <br/> | ||
<code><nowiki>{{formatnum:987.654,321|R}}</nowiki></code> <br/> | <code><nowiki>{{formatnum:987.654,321|R}}</nowiki></code> <br/> | ||
<code><nowiki>{{formatnum:987 654,321|R}}</nowiki></code> <br/> | <code><nowiki>{{formatnum:987 654,321|R}}</nowiki></code> <br/> | ||
<code><nowiki>{{formatnum:987&nbsp;654,321|R}}</nowiki></code> | <code><nowiki>{{formatnum:987&nbsp;654,321|R}}</nowiki></code> | ||
− | | Takes an unformatted number (arab, no group separators and <code>.</code> as decimal separator) and outputs it in the localized digit script and formatted with decimal and decimal group separators, according to the wiki's default locale. <br /> | + | | <translate><!--T:202--> |
− | The <code><nowiki>|</nowiki>R</code> parameter can be used to reverse the | + | Takes an unformatted number (arab, no group separators and <code>.</code> as decimal separator) and outputs it in the localized digit script and formatted with decimal and decimal group separators, according to the wiki's default locale. <br /> |
− | <small>{{warning}} | + | The <code><nowiki>|</nowiki>R</code> parameter can be used to reverse the behavior, for use in mathematical situations: it's reliable and should be used only to deformat numbers who are known to be formatted exactly as formatnum formats them with the wiki's locale. </translate><br/> |
− | <small>{{warning}} | + | <small>{{TNT|warning}} <translate><!--T:203--> |
− | <small>{{warning}} | + | Leading zeroes are not removed, you can use <nowiki>{{#expr:00001}}</nowiki> instead if you have [[Special:MyLanguage/Extension:ParserFunctions|Extension:ParserFunctions]] installed.</translate></small> <br/> |
+ | |||
+ | <small>{{TNT|warning}} <translate><!--T:204--> | ||
+ | If you don't input numbers in the exact format required, don't expect any reliable output, especially on non-English wikis.</translate></small><br/> | ||
+ | |||
+ | <small>{{TNT|warning}} <translate><!--T:205--> | ||
+ | The <code>NOSEP</code> ("no separators") parameter means that no group / decimal separators are changed; formatnum will only transform the digits themselves in languages which don't use the [[w:en:Hindu–Arabic numeral system|Hindu–Arabic numeral system]]. <code>NOSEP</code> can also prevent non-standard digit groupings you wouldn't expect.</translate></small> | ||
+ | |||
---- | ---- | ||
+ | |||
+ | <translate> | ||
+ | <!--T:206--> | ||
If you really need to format (according the wiki's locale) a number in unknown input format, you could try and use <code>formatnum</code> two times (but not if it can have a decimal group, or its separator will be eaten or the number won't be formatted). | If you really need to format (according the wiki's locale) a number in unknown input format, you could try and use <code>formatnum</code> two times (but not if it can have a decimal group, or its separator will be eaten or the number won't be formatted). | ||
+ | </translate> | ||
− | | 1.7 | + | | {{MW version|version=1.7|compact=y|comment=and after}} <br />{{MW version|version=1.13|compact=y|comment=and after|r=32012}} |
|- | |- | ||
| | | | ||
− | <code><nowiki>{{#dateformat:</nowiki>''date''<nowiki>}} | + | <code><nowiki>{{#dateformat:</nowiki>''date''<nowiki>}}</nowiki><br /> |
− | {{#formatdate:</nowiki>''date''<nowiki>}} | + | <code><nowiki>{{#formatdate:</nowiki>''date''<nowiki>}}</nowiki><br /> |
− | {{#dateformat:</nowiki>''date''{{!}}''format''<nowiki>}} | + | <code><nowiki>{{#dateformat:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki><br /> |
− | {{#formatdate:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code> | + | <code><nowiki>{{#formatdate:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code> |
| | | | ||
<code><nowiki>{{#dateformat:25 deC 2009|ymd}}</nowiki></code> <br/> | <code><nowiki>{{#dateformat:25 deC 2009|ymd}}</nowiki></code> <br/> | ||
− | → {{#dateformat:25 deC 2009|ymd}} (your pref), 2009 DeC 25 (default) <br/> | + | → {{#dateformat:25 deC 2009|ymd}} <translate><!--T:207--> |
+ | (your pref), 2009 DeC 25 (default)</translate> <br/> | ||
<code><nowiki>{{#formatdate:dec 25,2009|dmy}}</nowiki></code> <br/> | <code><nowiki>{{#formatdate:dec 25,2009|dmy}}</nowiki></code> <br/> | ||
− | → {{#formatdate:dec 25,2009|dmy}} (your pref), 25 Dec 2009 (default) <br/> | + | → {{#formatdate:dec 25,2009|dmy}} <translate><!--T:208--> |
+ | (your pref), 25 Dec 2009 (default)</translate> <br/> | ||
<code><nowiki>{{#dateformat:2009-12-25|mdy}}</nowiki></code> <br/> | <code><nowiki>{{#dateformat:2009-12-25|mdy}}</nowiki></code> <br/> | ||
− | → {{#dateformat:2009-12-25|mdy}} (your pref), December 25, 2009 (default) <br/> | + | → {{#dateformat:2009-12-25|mdy}} <translate><!--T:209--> |
+ | (your pref), December 25, 2009 (default)</translate> <br/> | ||
<code><nowiki>{{#formatdate:2009 dec 25|ISO 8601}}</nowiki></code> <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/> | + | → {{#formatdate:2009 dec 25|ISO 8601}} <translate><!--T:210--> |
+ | (your pref), 2009-12-25 (default)</translate> <br/> | ||
<code><nowiki>{{#dateformat:25 decEmber|mdy}}</nowiki></code> <br/> | <code><nowiki>{{#dateformat:25 decEmber|mdy}}</nowiki></code> <br/> | ||
− | → {{#dateformat:25 decEmber|mdy}} (your pref), DecEmber 25 (default) <br/> | + | → {{#dateformat:25 decEmber|mdy}} <translate><!--T:211--> |
+ | (your pref), DecEmber 25 (default)</translate> <br/> | ||
+ | <translate> | ||
+ | <!--T:212--> | ||
+ | ''Note:'' In the example hereinbefore, "your pref" refers to your date preference on the current MediaWiki wiki only. | ||
+ | </translate> | ||
− | + | | <translate><!--T:213--> | |
− | + | 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 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. </translate><br/><small> | |
− | | {{ | + | |
+ | {{TNT|warning}}<translate><!--T:214--> | ||
+ | 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).</translate></small> | ||
+ | |||
+ | | {{MW version|version=1.15|compact=y|comment=and after|r=48249}} | ||
|- | |- | ||
| <code><nowiki>{{lc:</nowiki>''string''<nowiki>}}</nowiki></code> | | <code><nowiki>{{lc:</nowiki>''string''<nowiki>}}</nowiki></code> | ||
| <code><nowiki>{{lc:DATA CENTER}}</nowiki></code> → {{lc:DATA CENTER}} | | <code><nowiki>{{lc:DATA CENTER}}</nowiki></code> → {{lc:DATA CENTER}} | ||
− | | The lowercase input. | + | | {{Anchor|lc|Lc|LC}}<translate><!--T:215--> |
− | | 1.5 | + | The lowercase input.</translate> |
+ | | {{MW version|version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{lcfirst:</nowiki>''string''<nowiki>}}</nowiki></code> | | <code><nowiki>{{lcfirst:</nowiki>''string''<nowiki>}}</nowiki></code> | ||
| <code><nowiki>{{lcfirst:DATA center}}</nowiki></code> → {{lcfirst:DATA center}} | | <code><nowiki>{{lcfirst:DATA center}}</nowiki></code> → {{lcfirst:DATA center}} | ||
− | | The input with the <u>very first</u> character lowercase. | + | | {{Anchor|lcfirst|Lcfirst|LCFIRST}}<translate><!--T:216--> |
− | | 1.5 | + | The input with the <u>very first</u> character lowercase.</translate> |
+ | | {{MW version|version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{uc:</nowiki>''string''<nowiki>}}</nowiki></code> | | <code><nowiki>{{uc:</nowiki>''string''<nowiki>}}</nowiki></code> | ||
| <code><nowiki>{{uc:text transform}}</nowiki></code> → {{uc:text transform}} | | <code><nowiki>{{uc:text transform}}</nowiki></code> → {{uc:text transform}} | ||
− | | The uppercase input. | + | | {{Anchor|uc|Uc|UC}}<translate><!--T:217--> |
− | | 1.5 | + | The uppercase input.</translate> |
+ | | {{MW version|version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
| <code><nowiki>{{ucfirst:</nowiki>''string''<nowiki>}}</nowiki></code> | | <code><nowiki>{{ucfirst:</nowiki>''string''<nowiki>}}</nowiki></code> | ||
| <code><nowiki>{{ucfirst:text TRANSFORM}}</nowiki></code> → {{ucfirst:text TRANSFORM}} | | <code><nowiki>{{ucfirst:text TRANSFORM}}</nowiki></code> → {{ucfirst:text TRANSFORM}} | ||
− | | The input with the <u>very first</u> character uppercase. | + | | {{Anchor|ucfirst|Ucfirst|UCFIRST}}<translate><!--T:218--> |
− | | 1.5 | + | The input with the <u>very first</u> character uppercase.</translate> |
+ | | {{MW version|version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
| <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><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><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 /> | + | | <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}} <translate><!--T:219--> |
− | | 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. | + | (first character of the string)</translate> <br /> |
+ | | <translate><!--T:220--> | ||
+ | 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. | ||
+ | <!--T:221--> | ||
Only the first character of the third parameter is used in versions up to 1.12, but by version 1.15 all the characters are used. | Only the first character of the third parameter is used in versions up to 1.12, but by version 1.15 all the characters are used. | ||
− | '''{{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. | + | <!--T:222--> |
− | | 1.8 | + | '''{{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.</translate> |
+ | | {{MW version|version=1.8|compact=y|comment=and after}} | ||
|- | |- | ||
| <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><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> | ||
817行目: | 1,090行目: | ||
<code><nowiki>{{padright:xyz|2}}</nowiki></code> → {{padright:xyz|2}} <br /> | <code><nowiki>{{padright:xyz|2}}</nowiki></code> → {{padright:xyz|2}} <br /> | ||
<code><nowiki>{{padright:|1|xyz}}</nowiki></code> → {{padright:|1|xyz}} <br /> | <code><nowiki>{{padright:|1|xyz}}</nowiki></code> → {{padright:|1|xyz}} <br /> | ||
− | | Identical to <code>padleft</code>, but adds padding characters to the right side. | + | | <translate><!--T:223--> |
− | | 1.8 | + | Identical to <code>padleft</code>, but adds padding characters to the right side.</translate> |
+ | | {{MW version|version=1.8|compact=y|comment=and after}} | ||
|} | |} | ||
+ | <translate> | ||
+ | <!--T:224--> | ||
+ | '''See also:''' [[Special:MyLanguage/Extension:StringFunctions|Extension:StringFunctions]]. | ||
− | + | === Localisation === <!--T:225--> | |
− | + | <!--T:226--> | |
+ | Here are the magic words which are used as main localisation tools. Other magic words will often depend on the wiki's locale and configuration or on the chosen language: see in particular [[#Date and time]], [[#Formatting]], [[#Miscellaneous]]. More magic words are added by the [[Special:MyLanguage/Extension:Translate|Translate extension]]. | ||
− | + | <!--T:227--> | |
− | + | The usage of these magic words can be very complex, and the documentation is currently incomplete; there's some more info on [[translatewiki:Special:MyLanguage/FAQ#PLURAL|PLURAL]], [[translatewiki:Special:MyLanguage/Grammar|GRAMMAR]], [[translatewiki:Special:MyLanguage/Gender|GENDER]]. | |
− | The usage of these magic words can be very complex, and the documentation is currently incomplete; there's some more info on [[translatewiki:FAQ#PLURAL|PLURAL]], [[translatewiki:Grammar|GRAMMAR]], [[translatewiki:Gender|GENDER]]. | + | </translate> |
{| class="wikitable" | {| class="wikitable" | ||
− | ! Usage | + | ! <translate><!--T:228--> |
− | ! Input → Output | + | Usage</translate> |
− | ! Description | + | ! <translate><!--T:229--> |
− | ! Version | + | Input → Output</translate> |
+ | ! <translate><!--T:230--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:231--> | ||
+ | Version</translate> | ||
|- | |- | ||
| {{Anchor|plural|Plural|PLURAL}}<code><nowiki>{{plural:2|</nowiki>''is''<nowiki>|</nowiki>''are''<nowiki>}}</nowiki></code> | | {{Anchor|plural|Plural|PLURAL}}<code><nowiki>{{plural:2|</nowiki>''is''<nowiki>|</nowiki>''are''<nowiki>}}</nowiki></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<br /><code><nowiki>{{plural:5|milion|miliony|milionów}}</nowiki></code> → milionów | + | | <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 /> <translate><!--T:232--> |
− | | Outputs the singular form (second parameter) if the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Its functioning is [[m:Help:Magic_words#Language-dependent_word_conversions|language-dependent]]. 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]]. | + | (For [[:w:Polish language|Polish]])</translate> <br /><code><nowiki>{{plural:2|milion|miliony|milionów}}</nowiki></code> → miliony<br /><code><nowiki>{{plural:5|milion|miliony|milionów}}</nowiki></code> → milionów |
+ | | <translate><!--T:233--> | ||
+ | Outputs the singular form (second parameter) if the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Its functioning is [[m:Special:MyLanguage/Help:Magic_words#Language-dependent_word_conversions|language-dependent]]. 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]].</translate> | ||
| | | | ||
|- | |- | ||
| {{Anchor|grammar|Grammar|GRAMMAR}}<code><nowiki>{{grammar:N|</nowiki>''noun''<nowiki>}}</nowiki></code> | | {{Anchor|grammar|Grammar|GRAMMAR}}<code><nowiki>{{grammar:N|</nowiki>''noun''<nowiki>}}</nowiki></code> | ||
| | | | ||
− | | Outputs the correct inflected form of the given word described by the inflection code after the colon ([[m:Help:Magic_words#Language-dependent_word_conversions|language-dependent]]). Grammar transformations are used for inflected languages like Polish. See also {{mediawiki|Manual:$wgGrammarForms}}. | + | | <translate><!--T:234--> |
− | | 1.7 | + | Outputs the correct inflected form of the given word described by the inflection code after the colon ([[m:Special:MyLanguage/Help:Magic_words#Language-dependent_word_conversions|language-dependent]]). Grammar transformations are used for inflected languages like Polish. See also {{mediawiki|Special:MyLanguage/Manual:$wgGrammarForms|$wgGrammarForms}}.</translate> |
+ | | {{MW version|version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
| {{Anchor|gender|Gender|GENDER}}<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> | | {{Anchor|gender|Gender|GENDER}}<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)'' | + | | ''<translate><!--T:235--> |
− | | A switch for the gender set in [[Special:Preferences]]. <br/> | + | (Depends on the named user's gender)</translate>'' |
− | ''Note:'' If 3rd parameter is omitted and user hasn't defined his/her gender, then <code>''text if user is male''</code> is returned. | + | | <translate><!--T:236--> |
− | | {{ | + | 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.</translate> | ||
+ | | {{MW version|version=1.15|compact=y|comment=and after|r=46247}} | ||
|- | |- | ||
| {{Anchor|int|INT}}<code><nowiki>{{int:</nowiki>''message name''<nowiki>}}</nowiki> | | {{Anchor|int|INT}}<code><nowiki>{{int:</nowiki>''message name''<nowiki>}}</nowiki> | ||
− | | <code><nowiki>{{int:</nowiki>edit<nowiki>}}</nowiki></code> → '''{{int:edit}}''' <br /><small>''(Depends on user language; try: [{{fullurl:{{FULLPAGENAME}}|uselang=fr}}#Localisation fr] • [{{fullurl:{{FULLPAGENAME}}|uselang=ja}}#Localisation ja])''</small> | + | | <code><nowiki>{{int:</nowiki>edit<nowiki>}}</nowiki></code> → '''{{int:edit}}''' <br /><small>''<translate><!--T:237--> |
− | | Internationalizes (translates) the given '''int'''erface (MediaWiki namespace) message into the user language. For <code>msgnw</code> and other transclusion magic words, see [[m:Help:Magic words#Template modifiers]]. | + | (Depends on user language; try: [{{fullurl:{{FULLPAGENAME}}|uselang=fr}}#Localisation fr] • [{{fullurl:{{FULLPAGENAME}}|uselang=ja}}#Localisation ja])</translate>''</small> |
− | ''Note that this can damage / confuse cache consistency in MediaWiki 1.17 and earlier, see [[bugzilla:14404|bug 14404]].'' | + | | <translate><!--T:238--> |
+ | Internationalizes (translates) the given '''int'''erface (MediaWiki namespace) message into the user language. For <code>msgnw</code> and other transclusion magic words, see [[m:Special:MyLanguage/Help:Magic words#Template modifiers|Help:Magic words#Template modifiers]]. | ||
+ | ''Note that this can damage / confuse cache consistency in MediaWiki 1.17 and earlier, see [[bugzilla:14404|bug 14404]].''</translate> | ||
| | | | ||
|- | |- | ||
| <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki> | | <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki> | ||
| <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki></code> → '''{{int:editsectionhint|MediaWiki}}''' | | <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki></code> → '''{{int:editsectionhint|MediaWiki}}''' | ||
− | | You may also use parameters with translations. <br />Parameters are designated in messages with: $1, $2, $3, etc. <br />For example, here is the message for ''editsectionhint'': Edit section: $1 <br />In this example, MediaWiki replaces $1. | + | | <translate><!--T:239--> |
+ | You may also use parameters with translations. <br />Parameters are designated in messages with: $1, $2, $3, etc. <br />For example, here is the message for ''editsectionhint'': Edit section: $1 <br />In this example, MediaWiki replaces $1.</translate> | ||
| | | | ||
|} | |} | ||
− | === Miscellaneous === | + | <translate> |
+ | === Miscellaneous === <!--T:240--> | ||
+ | </translate> | ||
{| class="wikitable plainlinks" | {| class="wikitable plainlinks" | ||
− | ! Usage | + | ! <translate><!--T:241--> |
− | ! Output | + | Usage</translate> |
− | ! Description | + | ! <translate><!--T:242--> |
− | ! Version | + | Output</translate> |
+ | ! <translate><!--T:243--> | ||
+ | Description</translate> | ||
+ | ! <translate><!--T:244--> | ||
+ | Version</translate> | ||
|- | |- | ||
| <code><nowiki>{{#language:</nowiki>''language code''<nowiki>}}</nowiki></code> <br /> | | <code><nowiki>{{#language:</nowiki>''language code''<nowiki>}}</nowiki></code> <br /> | ||
876行目: | 1,172行目: | ||
<code><nowiki>{{#language:ar|en}}</nowiki></code> | <code><nowiki>{{#language:ar|en}}</nowiki></code> | ||
| {{#language:language code}} <br />{{#language:ar}} <br />{{#language:language code|target language code}} <br />Arabic | | {{#language:language code}} <br />{{#language:ar}} <br />{{#language:language code|target language code}} <br />Arabic | ||
− | | The full name of the language for the given [[language code]]: native name (language autonym) by default, name translated in target language if a target language code is specified. [[Extension:CLDR]] must be installed for the translation to work. | + | | <translate><!--T:245--> |
− | | {{ | + | The full name of the language for the given [[Special:MyLanguage/language code|language code]]: native name (language autonym) by default, name translated in target language if a target language code is specified. [[Special:MyLanguage/Extension:CLDR|Extension:CLDR]] must be installed for the translation to work.</translate> |
− | {{ | + | | {{MW version|version=1.7|compact=y|comment=and after|r=14490}}<br /> {{MW version|version=1.18|compact=y|comment=and after|r=91875}} <translate><!--T:246--> |
+ | (translation)</translate> | ||
|- | |- | ||
| <code><nowiki>{{#special:</nowiki>''special page name''<nowiki>}}</nowiki> <br /><nowiki>{{#special:userlogin}}</nowiki></code> | | <code><nowiki>{{#special:</nowiki>''special page name''<nowiki>}}</nowiki> <br /><nowiki>{{#special:userlogin}}</nowiki></code> | ||
| {{#special:special page name}} <br />{{#special:userlogin}} | | {{#special:special page name}} <br />{{#special:userlogin}} | ||
− | | The localized name for the given canonical Special: page. | + | | <translate><!--T:247--> |
− | | {{ | + | The localized name for the given canonical Special: page.</translate> |
+ | | {{MW version|version=1.9|compact=y|comment=and after|r=17321}} | ||
|- | |- | ||
| <code><nowiki>{{#speciale:</nowiki>''special page name''<nowiki>}}</nowiki> <br /><nowiki>{{#speciale:userlogin}}</nowiki></code> | | <code><nowiki>{{#speciale:</nowiki>''special page name''<nowiki>}}</nowiki> <br /><nowiki>{{#speciale:userlogin}}</nowiki></code> | ||
| {{#speciale:special page name}} <br />{{#speciale:userlogin}} | | {{#speciale:special page name}} <br />{{#speciale:userlogin}} | ||
− | | The localized and URL-encoded name for the given canonical Special: page. | + | | <translate><!--T:248--> |
− | | {{ | + | The localized and URL-encoded name for the given canonical Special: page.</translate> |
+ | | {{MW version|version=1.20|compact=y|comment=and after}}<br />[[gerrit:4340]] | ||
|- | |- | ||
| <code><nowiki>{{#tag:</nowiki>''tagname'' <br/><nowiki>|</nowiki>''content'' <br/><nowiki>|</nowiki>''attribute1=value1'' <br /><nowiki>|</nowiki>''attribute2=value2''<br /><nowiki>}}</nowiki></code> | | <code><nowiki>{{#tag:</nowiki>''tagname'' <br/><nowiki>|</nowiki>''content'' <br/><nowiki>|</nowiki>''attribute1=value1'' <br /><nowiki>|</nowiki>''attribute2=value2''<br /><nowiki>}}</nowiki></code> | ||
− | | ''(Depends on parser tag)'' | + | | <translate><!--T:249--> |
− | | Alias for XML-style MediaWiki parser tags or extension tags. It allows execution of wiki code and [[Extension:ParserFunctions|parser functions]] within tags before the tag is processed. It also prevents parsing of tags in conditional paths that aren't executed (like in <code>#if</code> statements). Content between tags is passed as the first parameter, and any attributes for the tags can be passed as subsequent parameters. This example: | + | ''(Depends on parser tag)''</translate> |
+ | | <translate><!--T:250--> | ||
+ | Alias for XML-style MediaWiki parser tags or extension tags. It allows execution of wiki code and [[Special:MyLanguage/Extension:ParserFunctions|parser functions]] within tags before the tag is processed. It also prevents parsing of tags in conditional paths that aren't executed (like in <code>#if</code> statements). Content between tags is passed as the first parameter, and any attributes for the tags can be passed as subsequent parameters. This example: | ||
+ | <!--T:251--> | ||
<code><tagname ''attribute1''="''value1''" ''attribute2''="''value2''"></code>''Your content goes here''<code></tagname></code> | <code><tagname ''attribute1''="''value1''" ''attribute2''="''value2''"></code>''Your content goes here''<code></tagname></code> | ||
+ | <!--T:252--> | ||
…can be rewritten like this: | …can be rewritten like this: | ||
+ | <!--T:253--> | ||
<code><nowiki>{{#tag:</nowiki></code>''tagname''<code><nowiki>|</nowiki></code>''Your content goes here''<code><nowiki>|</nowiki></code>''attribute1''=''value1''<code><nowiki>|</nowiki></code>''attribute2''=''value2''<code><nowiki>}}</nowiki></code> | <code><nowiki>{{#tag:</nowiki></code>''tagname''<code><nowiki>|</nowiki></code>''Your content goes here''<code><nowiki>|</nowiki></code>''attribute1''=''value1''<code><nowiki>|</nowiki></code>''attribute2''=''value2''<code><nowiki>}}</nowiki></code> | ||
− | Example for the [[Extension:Cite|Cite extension]]'s <code><ref></code> tags: | + | <!--T:254--> |
+ | Example for the [[Special:MyLanguage/Extension:Cite|Cite extension]]'s <code><ref></code> tags: | ||
+ | |||
+ | <!--T:255--> | ||
<code><nowiki>{{#tag:ref|Citation text goes here, and you can include parser functions like {{#expr: ... }} and magic words like {{PAGENAME}}.|name="multiple"}}</nowiki></code> | <code><nowiki>{{#tag:ref|Citation text goes here, and you can include parser functions like {{#expr: ... }} and magic words like {{PAGENAME}}.|name="multiple"}}</nowiki></code> | ||
+ | </translate> | ||
− | <small>{{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 in the area reserved for content between the pipe characters <code>{{!}}{{!}}</code> before ''attribute1''.</small> | + | <small>{{TNT|warning}}<translate><!--T:256--> |
− | | {{ | + | 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 in the area reserved for content between the pipe characters <code>{{!}}{{!}}</code> before ''attribute1''.</translate></small> |
+ | | {{MW version|version=1.12|compact=y|comment=and after|r=29482}} | ||
|} | |} | ||
− | + | [[Category:Help{{langcat|Magic words}}|{{PAGENAME}}]] | |
− | + | [[Category:Time{{langcat|Magic words}}|{{PAGENAME}}]] | |
− | [[Category:Help|{{PAGENAME}}]] | + | [[Category:Magic words{{langcat|Magic words}}|{{PAGENAME}}]] |
− | [[Category:Time|{{PAGENAME}}]] | ||
− | [[Category:Magic words|{{PAGENAME}}]] |
2014年1月24日 (金) 08:31時点における版
Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info.
|
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 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 Help:Extension:ParserFunctions.
Variables and parser functions can use subst:, just like templates. 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 behavior 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 contents to appear at its normal position (before 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. This is especially useful, where a heading is created from within a template: the normal wiki section-edit would in this case edit the template code, which is normally counterintuitive to the user. If a template contains multiple headings, it may be necessary to add "__NOEDITSECTION__ " after each heading.
|
||
__NEWSECTIONLINK__
|
Adds a link beside the "edit" tab for adding a new section on a non-talk page (see Adding a section to the end). |
| |
__NONEWSECTIONLINK__
|
Removes the link beside the "edit" tab on pages in talk namespaces. |
| |
Categories | |||
__NOGALLERY__
|
Used on a category page, replaces thumbnails in the category view with normal links. |
| |
__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). |
| |
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 19213. |
| |
__INDEX__
|
Tell search engines to index the page (overrides $wgArticleRobotPolicies, but not robots.txt). It obeys $wgExemptFromUserRobotsControl variable. |
| |
__NOINDEX__
|
Tell search engines not to index the page (i.e. do not list in search engines' results). It obeys $wgExemptFromUserRobotsControl variable. |
| |
__STATICREDIRECT__
|
On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "このページへのリダイレクトがあればそのリダイレクトを修正". |
| |
__DISAMBIG__
|
Marks a page as a disambiguation page and places it in Special:DisambiguationPages, and places inward links in Special:DisambiguationPageLinks. See Extension:Disambiguator. | requires Disambiguator extension |
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 テンプレート:PAGENAME you would need to write {{テンプレート:PAGENAME}}
). In some cases, adding parameters will force the parser to invoke a template; for example, {{CURRENTDAYNAME|x}}
transcludes テンプレート: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.
The date and time magic words are formatted in the wiki content language. Since 1.19, they depend on the page content language.
Variable | Output | Description | Versions | |
---|---|---|---|---|
Year | ||||
{{CURRENTYEAR}}
|
2024 | Year | ||
Month | ||||
{{CURRENTMONTH}}
|
11 | Month (zero-padded number) | ||
{{CURRENTMONTHNAME}}
|
11月 | Month (name) | ||
{{CURRENTMONTHNAMEGEN}}
|
11月 | Month (genitive form) | ||
{{CURRENTMONTHABBREV}}
|
11月 | Month (abbreviation) |
| |
Day | ||||
{{CURRENTDAY}}
|
28 | Day of the month (unpadded number) | ||
{{CURRENTDAY2}}
|
28 | Day of the month (zero-padded number) |
| |
{{CURRENTDOW}}
|
4 | Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday) | ||
{{CURRENTDAYNAME}}
|
木曜日 | Day of the week (name) | ||
Time | ||||
{{CURRENTTIME}}
|
07:02 | Time (24-hour HH:mm format) | ||
{{CURRENTHOUR}}
|
07 | Hour (24-hour zero-padded number) | ||
Other | ||||
{{CURRENTWEEK}}
|
48 | Week (number) | ||
{{CURRENTTIMESTAMP}}
|
20241128070246 | YYYYMMDDHHmmss timestamp |
|
The following variables do the same as the preceding ones, 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}}
|
ひつじ小屋別館2代目 | The wiki's site name ($wgSitename). | |||
{{SERVER}}
|
http://littleprincess.sakura.ne.jp | Domain URL ($wgServer). | |||
{{SERVERNAME}}
|
littleprincess.sakura.ne.jp | Subdomain and domain name (no longer dependent on $wgServerName as of version 1.17). | |||
{{DIRMARK}} {{DIRECTIONMARK}}
|
|
Outputs a Unicode directional mark that matches the wiki's default language's direction (‎ on left-to-right wikis, ‏ on right-to-left wikis), useful in text with multi-directional text. Since 1.19, it depends on the page content language.
|
| ||
{{SCRIPTPATH}}
|
/mediawiki | Relative script path ($wgScriptPath). | |||
{{STYLEPATH}}
|
/mediawiki/skins | Relative style path ($wgStylePath). |
| ||
{{CURRENTVERSION}}
|
1.27.0 | The wiki's MediaWiki version. |
| ||
{{CONTENTLANGUAGE}} {{CONTENTLANG}}
|
ja ja |
The wiki's default interface language ($wgLanguageCode). |
| ||
Page | |||||
{{PAGEID}}
|
714 | Returns the page identifier. |
gerrit:9858 | ||
{{PROTECTIONLEVEL: action }}
|
Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the current page. Returns an empty string if not protected. |
| |||
Latest revision to current page | |||||
{{REVISIONID}}
|
2479 | Unique revision ID. |
| ||
{{REVISIONDAY}}
|
24 | Day edit was made (unpadded number). |
| ||
{{REVISIONDAY2}}
|
24 | Day edit was made (zero-padded number). |
| ||
{{REVISIONMONTH}}
|
01 | Month edit was made (zero-padded number as of 1.17+, unpadded number in prior versions). |
| ||
{{REVISIONMONTH1}}
|
1 | Month edit was made (unpadded number). |
| ||
{{REVISIONYEAR}}
|
2014 | Year edit was made. |
| ||
{{REVISIONTIMESTAMP}}
|
20140124083114 | Timestamp as of time of edit. |
| ||
{{REVISIONUSER}} {{URLENCODE:{{REVISIONUSER}}|WIKI}}
|
Wctaiwan Wctaiwan |
The username of the user who made the most recent edit to the page, or the current user when previewing an edit. |
| ||
{{REVISIONSIZE}}
|
67057 | The size (bytes of wikitext) of the current revision of this page |
gerrit:82650 | ||
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 are allowed (this can be changed with $wgRestrictDisplayTitle). It can be disabled or enabled by $wgAllowDisplayTitle; disabled by default before 1.10+, enabled by default thereafter. |
| |||
{{DEFAULTSORT:sortkey}} {{DEFAULTSORTKEY:sortkey}} {{DEFAULTCATEGORYSORT:sortkey}} {{DEFAULTSORT:sortkey|noerror}} {{DEFAULTSORT:sortkey|noreplace}}
|
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. It can take a second argument of noerror or noreplace to suppress error messages when multiple defaultsortkeys are used on one page or to make this defaultsort do nothing if a defaultsort was already specified earlier in the page.
|
(for noerror and noreplace) |
Statistics
Numbers returned by these variables normally contain separators (commas, dots or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, {{NUMBEROFPAGES}}
→ 1,057 and {{NUMBEROFPAGES:R}}
→ 1057).
Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example {{PAGESINCATEGORY:Help}}
and {{PAGESINCATEGORY:Help|R}}
, or {{PAGESINCATEGORY:Help|subcats}}
and {{PAGESINCATEGORY:Help|subcats|R}}
). Also applicable to {{PAGESIZE:page name}}
hereinbefore.
The number magic words are formatted in the wiki content language. Since 1.19, it depends on the page content language.
Variable | Output | Description | Versions | |
---|---|---|---|---|
{{NUMBEROFPAGES}}
|
1,057 | Number of wiki pages. |
| |
{{NUMBEROFARTICLES}}
|
427 | Number of pages in content namespaces. | ||
{{NUMBEROFFILES}}
|
101 | Number of uploaded files. |
| |
{{NUMBEROFEDITS}}
|
2,806 | Number of wiki edits. |
| |
{{NUMBEROFVIEWS}}
|
2,589,435 | Number of page views. Usually useless on a wiki using caching. |
| |
{{NUMBEROFUSERS}}
|
199 | Number of registered users. |
| |
{{NUMBEROFADMINS}}
|
1 | Number of users in the sysop group. |
| |
{{NUMBEROFACTIVEUSERS}}
|
0 | Number of active users, based on the criteria used in Special:Statistics. |
| |
{{PAGESINCATEGORY:categoryname}} {{PAGESINCAT:categoryname}}
|
48 48 |
[Expensive] Number of pages (including subcategories and files) in the given category. |
| |
{{PAGESINCATEGORY:categoryname|all}} {{PAGESINCATEGORY:categoryname|pages}} {{PAGESINCATEGORY:categoryname|subcats}} {{PAGESINCATEGORY:categoryname|files}}
|
48 48 0 0 |
[Expensive] Respectively, the number of
in the given category. |
gerrit:12790 | |
{{NUMBERINGROUP:groupname}} {{NUMINGROUP:groupname}}
|
1 1 ({{NUMBERINGROUP:bureaucrat}} used here) |
Number of users in a specific group. |
| |
{{PAGESINNS:index}} {{PAGESINNAMESPACE:index}}
|
Not enabled | [Expensive] 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 $wgAllowSlowParserFunctions.
|
|
Page names
Variable | Output | Description | Versions | |
---|---|---|---|---|
{{FULLPAGENAME}}
|
ヘルプ:Magic words | Namespace and full page title (including all subpage levels). |
| |
{{PAGENAME}}
|
Magic words | Full page title (including all subpage levels) without the namespace. | ||
{{BASEPAGENAME}}
|
Magic words | Page title of the page in the immediately superior subpage level without the namespace ("Title/foo" on "Help:Title/foo/bar").
For more complex splitting, use |
| |
{{SUBPAGENAME}}
|
Magic words | The subpage title ("bar" on "Help:Title/foo/bar"). |
| |
{{SUBJECTPAGENAME}} {{ARTICLEPAGENAME}}
|
ヘルプ:Magic words ヘルプ:Magic words |
Full page name of the associated subject (e.g. article or file). Useful on talk pages. |
| |
{{TALKPAGENAME}}
|
ヘルプ・トーク:Magic words | Full page name of the associated talk page. |
|
The {{BASEPAGENAME}}
and {{SUBPAGENAME}}
magic words only work in namespaces that have subpages enabled. See $wgNamespacesWithSubpages for information on enabling subpages.
As of 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
For example, if page name is "L'Aquila", the following code will produce the string "Numeric char encoding":
{{#switch:{{PAGENAME}} | L'Aquila = No translation | L = Not OK | L'Aquila = Entity escaping | L'Aquila = Numeric char encoding }}
URL encoded page names
The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters HTML escaped using numeric character encoding):
-
{{FULLPAGENAMEE}}
- {{PAGENAMEE}}
- {{BASEPAGENAMEE}}
- {{SUBPAGENAMEE}}
- {{SUBJECTPAGENAMEE}}
- {{ARTICLEPAGENAMEE}}
- {{TALKPAGENAMEE}}
Note that {{PAGENAME}}
, {{PAGENAMEE}}
and {{urlencode:}}
have distinct implementations. See Manual:PAGENAMEE encoding for details.
Namespaces
Variable | Output | Description | Versions | |
---|---|---|---|---|
{{NAMESPACE}}
|
ヘルプ | Name of the page's namespace | ||
{{NAMESPACENUMBER}}
|
12 | ID of the page's namespace |
gerrit:4056 | |
{{SUBJECTSPACE}} {{ARTICLESPACE}}
|
ヘルプ ヘルプ |
Name of the associated content namespace |
| |
{{TALKSPACE}}
|
ヘルプ・トーク | Name of the associated talk namespace |
|
The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded):
-
{{NAMESPACEE}}
- {{SUBJECTSPACEE}}
- {{TALKSPACEE}}
As of 1.15+, these can take a full-page-name parameter and will return the requested namespace associated with that page, instead of with the current page:
-
{{NAMESPACE:Template:Main Page}}
→ テンプレート -
{{SUBJECTSPACE:Template:Main Page}}
→ テンプレート -
{{TALKSPACE:Template:Main Page}}
→ テンプレート・トーク
Parameter must not be a namespace name:
-
{{SUBJECTSPACE:Help talk}}
→ (Empty)
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 ParserFunctions extension. For those see Help:Extension:ParserFunctions.
Technical metadata of another page
Parser function | Output (for page MediaWiki) |
Description | Versions | |
---|---|---|---|---|
{{PAGEID: page name }}
|
890 | [Expensive] Returns the page identifier of the specified page*. |
gerrit:76534 | |
{{PAGESIZE: page name }} {{PAGESIZE: page name |R}}
|
157 157 |
[Expensive] Returns the byte size of the specified page. Use "<code>|R" to get raw (unformatted) numbers. |
| |
{{PROTECTIONLEVEL: action | page name }}
|
Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the specified page. Returns an empty string if not protected. |
| ||
{{REVISIONID: page name }}
|
4760 | [Expensive] Unique revision ID of the last revision on the specified page*. |
gerrit:76534 | |
{{REVISIONDAY: page name }}
|
24 | [Expensive] Day of edit from the last revision of the specified page* (unpadded number). |
gerrit:76534 | |
{{REVISIONDAY2: page name }}
|
24 | [Expensive] Day of edit from the last revision of the specified page* (zero-padded number). |
gerrit:76534 | |
{{REVISIONMONTH: page name }}
|
07 | [Expensive] Month of edit from the last revision of the specified page* (zero-padded number as of 1.17+, unpadded number in prior versions). |
gerrit:76534 | |
{{REVISIONMONTH1: page name }}
|
7 | [Expensive] Month of edit from the last revision of the specified page* (unpadded number). |
gerrit:76534 | |
{{REVISIONYEAR: page name }}
|
2016 | [Expensive] Year of edit from the last revision of the specified page*. |
gerrit:76534 | |
{{REVISIONTIMESTAMP: page name }}
|
20160724002620 | [Expensive] Timestamp as of time of edit on the specified page*. |
gerrit:76534 | |
{{REVISIONUSER: page name }}
|
しが | [Expensive] The username from the last revision on the specified page*. |
gerrit:76534 | |
*When the given param is equal to the current title of the parser, the parser function will yield the previous versions on preview and on substitution, that includes empty strings when used on page creation, but using the values from the current version for page view, including viewing old revisions. In this case it is a non-expensive parser function. |
URL data
Parser function | Input → Output | Description | Versions | ||||
---|---|---|---|---|---|---|---|
{{localurl:page name}} {{localurl:page name|query_string}}
|
{{localurl:MediaWiki}} → /mediawiki/index.php?title=MediaWiki {{localurl:MediaWiki|printable=yes}} → /mediawiki/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}} → http://littleprincess.sakura.ne.jp/mediawiki/index.php?title=%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:Top_level
|
A protocol-relative path to the title. This will also resolve interwiki prefixes. Note: Unbracketed (plain) protocol-relative links are not automagically linked. |
| ||||
{{canonicalurl:page name}} {{canonicalurl:page name|query_string}} {{canonicalurl:interwiki:remote page name|query_string}}
|
{{canonicalurl:Category:Top level}} → http://littleprincess.sakura.ne.jp/mediawiki/index.php?title=%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:Top_level
|
The absolute path to the title, using the canonical URL. This will also resolve interwiki prefixes. |
| ||||
{{filepath:file name}} {{filepath:file name|nowiki}} {{filepath:file name|thumbnail_size}}
|
{{filepath:Wiki.png}} → http://littleprincess.sakura.ne.jp/mediawiki/images/b/bc/Wiki.png
|
A protocol-relative path to the full size or thumbnail (1.18+) of a media file. |
| ||||
{{urlencode:string}} (or {{urlencode:string|QUERY}} ) {{urlencode:string|WIKI}} {{urlencode:string|PATH}}
|
{{urlencode:x:y/z á é}} (or {{urlencode:x:y/z á é|QUERY}}) → x%3Ay%2Fz+%C3%A1+%C3%A9 {{urlencode:x:y/z á é|WIKI}} → x:y/z_%C3%A1_%C3%A9 {{urlencode:x:y/z á é|PATH}} → x%3Ay%2Fz%20%C3%A1%20%C3%A9
Note that the default changed from |
The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete Extension:StringFunctions. |
| ||||
{{anchorencode:string}}
|
{{anchorencode:x y z á é}} → x_y_z_.C3.A1_.C3.A9
|
The input encoded for use in URL section anchors (after the “#” symbol in a URL). |
|
Namespaces
{{ns:}}
returns the current localized name for the namespace with that index, canonical name, or local alias. Thus {{ns:6}}
, {{ns:File}}
, and {{ns:Image}}
(an old name for the File namespace) all return "ファイル". On a wiki where the content language is French, {{ns:Fichier}}
is also valid, but {{ns:Datei}}
(the localisation of "File" in German) is not.
{{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}} / {{ns:Media}}
|
メディア | |||
{{ns:-1}} / {{ns:Special}}
|
特別 | |||
{{ns:0}} / {{ns:}}
|
{{ns:1}} / {{ns:Talk}}
|
トーク | ||
{{ns:2}} / {{ns:User}}
|
利用者 | {{ns:3}} / {{ns:User talk}}
|
利用者・トーク | |
{{ns:4}} / {{ns:Project}}
|
ひつじ小屋別館2代目 Varies between wikis |
{{ns:5}} / {{ns:Project talk}}
|
ひつじ小屋別館2代目・トーク | |
{{ns:6}} / {{ns:File}} or {{ns:Image}}
|
ファイル | {{ns:7}} / {{ns:File talk}} or {{ns:Image talk}}
|
ファイル・トーク | |
{{ns:8}} / {{ns:MediaWiki}}
|
MediaWiki | {{ns:9}} / {{ns:MediaWiki talk}}
|
MediaWiki・トーク | |
{{ns:10}} / {{ns:Template}}
|
テンプレート | {{ns:11}} / {{ns:Template talk}}
|
テンプレート・トーク | |
{{ns:12}} / {{ns:Help}}
|
ヘルプ | {{ns:13}} / {{ns:Help talk}}
|
ヘルプ・トーク | |
{{ns:14}} / {{ns:Category}}
|
カテゴリ | {{ns:15}} / {{ns:Category talk}}
|
カテゴリ・トーク |
Don't confuse localised namespaces with custom namespaces.
Formatting
Usage | Input → Output | Description | Version | ||
---|---|---|---|---|---|
{{formatnum:unformatted number}}
|
Unsupported: Examples of wrong input (unreliable output), with or without |
Takes an unformatted number (arab, no group separators and . as decimal separator) and outputs it in the localized digit script and formatted with decimal and decimal group separators, according to the wiki's default locale. The テンプレート:Warning/core If you don't input numbers in the exact format required, don't expect any reliable output, especially on non-English wikis. テンプレート:Warning/core The If you really need to format (according the wiki's locale) a number in unknown input format, you could try and use |
| ||
|
|
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: mdy , dmy , ymd , ISO 8601 (all case sensitive). If only the month and day are given, only mdy and dmy 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. テンプレート:Warning/coreAlthough 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). |
| ||
{{lc:string}}
|
{{lc:DATA CENTER}} → data center
|
The lowercase input. |
| ||
{{lcfirst:string}}
|
{{lcfirst:DATA center}} → dATA center
|
The input with the very first character lowercase. |
| ||
{{uc:string}}
|
{{uc:text transform}} → TEXT TRANSFORM
|
The uppercase input. |
| ||
{{ucfirst:string}}
|
{{ucfirst:text TRANSFORM}} → Text TRANSFORM
|
The input with the very first character uppercase. |
| ||
{{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.
Only the first character of the third parameter is used in versions up to 1.12, but by version 1.15 all the characters are used. Bug (fixed in r45734): multibyte characters are interpreted as two characters, which can skew width. These also cannot be used as padding characters. |
| ||
{{padright:xyz|stringlength}} {{padright:xyz|strlen|char}} {{padright:xyz|strlen|string}}
|
{{padright:xyz|5}} → xyz00
|
Identical to padleft , but adds padding characters to the right side.
|
|
See also: Extension:StringFunctions.
Localisation
Here are the magic words which are used as main localisation tools. Other magic words will often depend on the wiki's locale and configuration or on the chosen language: see in particular #Date and time, #Formatting, #Miscellaneous. More magic words are added by the Translate extension.
The usage of these magic words can be very complex, and the documentation is currently incomplete; there's some more info on PLURAL, GRAMMAR, GENDER.
Usage | Input → Output | Description | Version | |
---|---|---|---|---|
{{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}} → is {{plural:1|is|are}} → is {{plural:2|is|are}} → are (For Polish) {{plural:2|milion|miliony|milionów}} → miliony{{plural:5|milion|miliony|milionów}} → milionów
|
Outputs the singular form (second parameter) if the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Its functioning is language-dependent. 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 $wgGrammarForms. |
| ||
{{gender:username
|
(Depends on the named user's gender) | A switch for the gender set in Special:Preferences. Note: If 3rd parameter is omitted and user hasn't defined his/her gender, then |
| |
{{int:message name}}
|
<code>{{int:edit}} → 編集 (Depends on user language; try: fr • ja) |
Internationalizes (translates) the given interface (MediaWiki namespace) message into the user language. For msgnw and other transclusion magic words, see Help:Magic words#Template modifiers.
Note that this can damage / confuse cache consistency in MediaWiki 1.17 and earlier, see bug 14404. |
||
{{int:editsectionhint|MediaWiki}}
|
<code>{{int:editsectionhint|MediaWiki}} → 節を編集: MediaWiki | You may also use parameters with translations. Parameters are designated in messages with: $1, $2, $3, etc. For example, here is the message for editsectionhint: Edit section: $1 In this example, MediaWiki replaces $1. |
Miscellaneous
Usage | Output | Description | Version | ||
---|---|---|---|---|---|
{{#language:language code}}
|
language code العربية language code Arabic |
The full name of the language for the given language code: native name (language autonym) by default, name translated in target language if a target language code is specified. Extension:CLDR must be installed for the translation to work. |
| ||
{{#special:special page name}}
|
特別:Special page name 特別:ログイン |
The localized name for the given canonical Special: page. |
| ||
{{#speciale:special page name}}
|
%E7%89%B9%E5%88%A5:Special_page_name %E7%89%B9%E5%88%A5:%E3%83%AD%E3%82%B0%E3%82%A4%E3%83%B3 |
The localized and URL-encoded name for the given canonical Special: page. |
gerrit:4340 | ||
{{#tag:tagname
|
(Depends on parser tag) | Alias for XML-style MediaWiki parser tags or extension tags. It allows execution of wiki code and parser functions within tags before the tag is processed. It also prevents parsing of tags in conditional paths that aren't executed (like in #if statements). Content between tags is passed as the first parameter, and any attributes for the tags can be passed as subsequent parameters. This example:
…can be rewritten like this:
Example for the Cite extension's
テンプレート:Warning/coreYou must write |
|