Editing Help:Magic words
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | |||
{{TOC right}} | {{TOC right}} | ||
− | |||
− | + | '''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 [https://www.mediawiki.org/wiki/Manual:Magic_words this page]. | |
− | + | ||
− | + | ||
− | + | 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.'' '''<code><nowiki>{{FOO}}</nowiki></code>'''. As such, they look a lot like [[Help:Templates|templates]]. | |
− | + | * '''Parser functions''': these take parameters and are either of the form '''<code><nowiki>{{foo:...}}</nowiki></code>''' or '''<code><nowiki>{{#foo:...}}</nowiki></code>'''. See also [https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions Help:Extension:ParserFunctions] in the Mediawiki manual. | |
− | + | Variables and parser functions can use [https://www.mediawiki.org/wiki/Manual:Substitution subst:] (substitution), 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 == | + | == 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. | ||
{| class="wikitable" | {| class="wikitable" | ||
− | |||
− | |||
|- | |- | ||
− | + | ! width="20%" | <!--T:9--> | |
− | + | Word | |
+ | ! <!--T:10--> | ||
+ | Description | ||
+ | ! width="15%" | <!--T:11--> | ||
+ | Versions | ||
|- | |- | ||
− | + | ! colspan="3" style="background-color: #DDDDDD;"| <!--T:257--> | |
− | + | [[<tvar|manual-toc>Special:MyLanguage/Manual:Table of contents</>|Table of contents]] | |
|- | |- | ||
− | + | | <code><nowiki>__NOTOC__</nowiki></code> | |
− | + | | <!--T:12--> | |
+ | Hides the [[<tvar|manual-toc>Special:MyLanguage/table of contents</>|table of contents]] (TOC). | ||
+ | | | ||
|- | |- | ||
− | + | | <code><nowiki>__FORCETOC__</nowiki></code> | |
− | + | | <!--T:13--> | |
+ | Forces the table of contents to appear at its normal position (before the first header, overriding <tvar|notoc><code><nowiki>__NOTOC__</nowiki></code></>). | ||
+ | | | ||
|- | |- | ||
− | + | | <code><nowiki>__TOC__</nowiki></code> | |
− | + | | <!--T:14--> | |
+ | Places a table of contents at the word's current position (overriding <tvar|notoc><code><nowiki>__NOTOC__</nowiki></code></>). If this is used multiple times, the table of contents will appear at the first word's position. | ||
+ | | | ||
|- | |- | ||
− | + | ! colspan="3" style="background-color: #DDDDDD;"| <!--T:15--> | |
− | + | Editing | |
|- | |- | ||
− | + | | <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 "<tvar|noeditsection><code><nowiki>__NOEDITSECTION__</nowiki></code></>" after each heading. | ||
+ | | | ||
|- | |- | ||
− | + | | <code><nowiki>__NEWSECTIONLINK__</nowiki></code> | |
− | + | | | |
+ | Adds a link beside the "edit" tab for adding a new section on a non-talk page (see {{mediawiki|<tvar|meta-help-section>m:Special:MyLanguage/Help:Section#Adding a section at the end</>|Adding a section to the end}}). | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | | <code><nowiki>__NONEWSECTIONLINK__</nowiki></code> | |
− | + | | <!--T:18--> | |
+ | Removes the link beside the "edit" tab on pages in talk namespaces. | ||
+ | | {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=47522}} | ||
|- | |- | ||
− | + | ! colspan="3"| <!--T:19--> | |
− | + | Categories | |
|- | |- | ||
− | + | | <code><nowiki>__NOGALLERY__</nowiki></code> | |
− | + | | <!--T:20--> | |
+ | Used on a category page, replaces thumbnails in the category view with normal links. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | | <code><nowiki>__HIDDENCAT__</nowiki></code> | |
− | + | | <!--T:21--> | |
+ | 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 [[<tvar|help-preferences>Special:MyLanguage/Help:Preferences</>|user preferences]] to show them).<!-- hiddencategory hiddencat hide category categories --> | ||
+ | | {{ {{TNTN|MW version}} |version=1.13|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | ! colspan="3" style="background-color: #DDDDDD;"| <!--T:22--> | |
− | + | Language conversion | |
+ | |- | ||
+ | | <code><nowiki>__NOCONTENTCONVERT__</nowiki></code> <br /> <code><nowiki>__NOCC__</nowiki></code> | ||
+ | | <!--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. | ||
+ | | | ||
+ | |- | ||
+ | | <code><nowiki>__NOTITLECONVERT__</nowiki></code> <br /> <code><nowiki>__NOTC__</nowiki></code> | ||
+ | | <!--T:24--> | ||
+ | On wikis with language variants, don't perform language conversion on the title (all other content is converted). | ||
+ | | | ||
+ | |- | ||
+ | ! colspan="3" style="background-color: #DDDDDD;"| <!--T:25--> | ||
+ | Other | ||
+ | |- | ||
+ | | <code><nowiki>__START__</nowiki></code> | ||
+ | | <!--T:26--> | ||
+ | No effect. <small>Removed in [[Special:Code/MediaWiki/1695|r1695]] and completly removed in [[Special:Code/MediaWiki/24784|r24784]]</small> | ||
+ | | {{ {{TNTN|MW version}} |version=1.10|compact=y|comment=and before|r=1610}} | ||
+ | |- | ||
+ | | <code><nowiki>__END__</nowiki></code> | ||
+ | | <!--T:27--> | ||
+ | Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in {{mediawiki|rev:19213|19213}}. | ||
+ | | {{ {{TNTN|MW version}} |version=1.1|compact=y|version2=1.8}} | ||
+ | |- | ||
+ | | <code><nowiki>__INDEX__</nowiki></code> | ||
+ | | <!--T:28--> | ||
+ | Tell search engines to index the page (overrides <tvar|manual-wg-bot-policy>{{mediawiki|Special:MyLanguage/Manual:$wgArticleRobotPolicies|$wgArticleRobotPolicies}}</>, but not robots.txt). It obeys <tvar|manual-wg-exempt-from-bot>[[Special:MyLanguage/Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]]</> variable. | ||
+ | | {{ {{TNTN|MW version}} |version=1.14|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>__NOINDEX__</nowiki></code> | ||
+ | | <!--T:29--> | ||
+ | Tell search engines not to index the page (i.e. do not list in search engines' results). It obeys <tvar|manual-wg-exempt-from-bot>[[Special:MyLanguage/Manual:$wgExemptFromUserRobotsControl|$wgExemptFromUserRobotsControl]]</> variable. | ||
+ | | {{ {{TNTN|MW version}} |version=1.14|compact=y|comment=and after|r=37973}} | ||
+ | |- | ||
+ | | <code><nowiki>__STATICREDIRECT__</nowiki></code> | ||
+ | | <!--T:30--> | ||
+ | On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "<tvar|fixDoubleRedirects>{{int:Fix-double-redirects}}</>" (which requires [[<tvar|var>Special:MyLanguage/Manual:$wgFixDoubleRedirects</>|$wgFixDoubleRedirects]]). | ||
+ | | {{ {{TNTN|MW version}} |version=1.13|compact=y|comment=and after|r=37928}} | ||
+ | |- | ||
+ | | <code><nowiki>__DISAMBIG__</nowiki></code> | ||
+ | | <!--T:31--> | ||
+ | Marks a page as a disambiguation page and places it in [[Special:DisambiguationPages]], and places inward links in [[Special:DisambiguationPageLinks]]. See <tvar|ext-disambiguator>{{ll|Extension:Disambiguator}}</>. | ||
+ | | <!--T:32--> | ||
+ | requires <tvar|ext-disambiguator>{{ll|Extension:Disambiguator}}</> | ||
|} | |} | ||
− | + | {{anchor|Variables}} | |
− | + | ||
− | |||
− | + | == Variables == <!--T:33--> | |
− | + | ||
− | + | <!--T:34--> | |
− | + | Variables return information about the current page, wiki, or date. Their syntax is similar to [[<tvar|help-templates>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 <tvar|code><code><nowiki>{{</nowiki>{{ns:10}}:</>PAGENAME<tvar|code-end><nowiki>}}</nowiki></code></>). In some cases, adding parameters will force the parser to invoke a template; for example, <tvar|tpl-currentdayname-code><code><nowiki>{{CURRENTDAYNAME|x}}</nowiki></code></> transcludes <tvar|tpl-currentdayname-result>[[{{ns:10}}:CURRENTDAYNAME]]</>, ''not'' the variable. | ||
+ | |||
+ | |||
+ | {{anchor|Date and time}} | ||
+ | |||
+ | === Date and time === <!--T:36--> | ||
+ | |||
+ | <!--T:37--> | ||
+ | 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. | ||
+ | |||
+ | <!--T:39--> | ||
+ | The date and time magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, they depend on the [[<tvar|manual-pagelang>Special:MyLanguage/Manual:Language#page-content-lang</>|page content language]]. | ||
+ | |||
+ | {| class="wikitable" | ||
|- | |- | ||
− | + | ! <!--T:40--> | |
− | + | Variable | |
− | + | ! <!--T:41--> | |
+ | Output | ||
+ | ! <!--T:42--> | ||
+ | Description | ||
+ | ! <!--T:43--> | ||
+ | Versions | ||
|- | |- | ||
− | + | ! colspan="4" style="background-color: #DDDDDD;"| <!--T:44--> | |
− | + | Year{{Anchor|CURRENTYEAR}} | |
− | + | ||
|- | |- | ||
− | + | | <code><nowiki>{{CURRENTYEAR}}</nowiki></code> | |
− | + | | {{CURRENTYEAR}} | |
− | + | | <!--T:45--> | |
+ | Year | ||
+ | | | ||
|- | |- | ||
− | + | ! colspan="4" style="background-color: #DDDDDD;"| <!--T:46--> | |
− | + | Month{{Anchor|CURRENTMONTH|CURRENTMONTH1|CURRENTMONTHNAME|CURRENTMONTHNAMEGEN|CURRENTMONTHABBREV}} | |
− | + | ||
|- | |- | ||
− | + | | <code><nowiki>{{CURRENTMONTH}}</nowiki></code> | |
− | + | | {{CURRENTMONTH}} | |
− | + | | <!--T:47--> | |
+ | Month (zero-padded number) | ||
+ | | | ||
|- | |- | ||
− | + | | <code><nowiki>{{CURRENTMONTH1}}</nowiki></code> | |
− | + | | {{CURRENTMONTH1}} | |
− | + | | <!--T:304--> | |
+ | Month (non-zero-padded number) | ||
+ | | | ||
|- | |- | ||
− | + | | <code><nowiki>{{CURRENTMONTHNAME}}</nowiki></code> | |
− | + | | {{CURRENTMONTHNAME}} | |
− | + | | <!--T:48--> | |
+ | Month (name) | ||
+ | | | ||
|- | |- | ||
− | + | | <code><nowiki>{{CURRENTMONTHNAMEGEN}}</nowiki></code> | |
− | + | | {{CURRENTMONTHNAMEGEN}} | |
− | + | | <!--T:49--> | |
+ | Month ([[wikipedia:genitive|genitive form]]) | ||
+ | | | ||
|- | |- | ||
− | + | | <code><nowiki>{{CURRENTMONTHABBREV}}</nowiki></code> | |
− | + | | {{CURRENTMONTHABBREV}} | |
− | + | | <!--T:50--> | |
+ | Month (abbreviation) | ||
+ | | {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | ! colspan="4" style="background-color: #DDDDDD;"| <!--T:51--> | |
− | + | Day{{Anchor|CURRENTDAY|CURRENTDAY2|CURRENTDOW|CURRENTDAYNAME}} | |
− | + | ||
|- | |- | ||
− | + | | <code><nowiki>{{CURRENTDAY}}</nowiki></code> | |
− | + | | {{CURRENTDAY}} | |
− | + | | <!--T:52--> | |
− | |}<!-- | + | Day of the month (unpadded number) |
+ | | | ||
+ | |- | ||
+ | | <code><nowiki>{{CURRENTDAY2}}</nowiki></code> | ||
+ | | {{CURRENTDAY2}} | ||
+ | | <!--T:53--> | ||
+ | Day of the month (zero-padded number) | ||
+ | | {{ {{TNTN|MW version}} |version=1.6|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{CURRENTDOW}}</nowiki></code> | ||
+ | | {{CURRENTDOW}} | ||
+ | | <!--T:54--> | ||
+ | Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday) | ||
+ | | | ||
+ | |- | ||
+ | | <code><nowiki>{{CURRENTDAYNAME}}</nowiki></code> | ||
+ | | {{CURRENTDAYNAME}} | ||
+ | | <!--T:55--> | ||
+ | Day of the week (name) | ||
+ | | | ||
+ | |- | ||
+ | ! colspan="4" style="background-color: #DDDDDD;"| <!--T:56--> | ||
+ | Time{{Anchor|CURRENTTIME|CURRENTHOUR}} | ||
+ | |- | ||
+ | | <code><nowiki>{{CURRENTTIME}}</nowiki></code> | ||
+ | | {{CURRENTTIME}} | ||
+ | | <!--T:57--> | ||
+ | Time (24-hour HH:mm format) | ||
+ | | | ||
+ | |- | ||
+ | | <code><nowiki>{{CURRENTHOUR}}</nowiki></code> | ||
+ | | {{CURRENTHOUR}} | ||
+ | | <!--T:58--> | ||
+ | Hour (24-hour zero-padded number) | ||
+ | | | ||
+ | |- | ||
+ | ! colspan="4" style="background-color: #DDDDDD;"| <!--T:59--> | ||
+ | Other{{Anchor|CURRENTWEEK|CURRENTTIMESTAMP}} | ||
+ | |- | ||
+ | | <code><nowiki>{{CURRENTWEEK}}</nowiki></code> | ||
+ | | {{CURRENTWEEK}} | ||
+ | | <!--T:60--> | ||
+ | Week (number) | ||
+ | | | ||
+ | |- | ||
+ | | <code><nowiki>{{CURRENTTIMESTAMP}}</nowiki></code> | ||
+ | | {{CURRENTTIMESTAMP}} | ||
+ | | <!--T:61--> | ||
+ | YYYYMMDDHHmmss timestamp | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
+ | |} | ||
− | --> | + | <!--T:62--> |
+ | The following variables do the same as the preceding ones, but using the site's server config or <tvar|manual-wg-localtimezone>[[Special:MyLanguage/Manual:$wgLocaltimezone|$wgLocaltimezone]]</>. | ||
− | {| | + | * <code><nowiki>{{LOCALYEAR}}</nowiki> |
− | ! | + | * <nowiki>{{LOCALMONTH}}</nowiki> |
+ | * <nowiki>{{LOCALMONTH1}}</nowiki> | ||
+ | * <nowiki>{{LOCALMONTHNAME}}</nowiki> | ||
+ | * <nowiki>{{LOCALMONTHNAMEGEN}}</nowiki> | ||
+ | * <nowiki>{{LOCALMONTHABBREV}}</nowiki> | ||
+ | * <nowiki>{{LOCALDAY}}</nowiki> | ||
+ | * <nowiki>{{LOCALDAY2}}</nowiki> | ||
+ | * <nowiki>{{LOCALDOW}}</nowiki> | ||
+ | * <nowiki>{{LOCALDAYNAME}}</nowiki> | ||
+ | * <nowiki>{{LOCALTIME}}</nowiki> | ||
+ | * <nowiki>{{LOCALHOUR}}</nowiki> | ||
+ | * <nowiki>{{LOCALWEEK}}</nowiki> | ||
+ | * <nowiki>{{LOCALTIMESTAMP}}</nowiki></code> | ||
+ | |||
+ | <!--T:63--> | ||
+ | ''For more thorough time formatting, you may want to install <tvar|ext-parserfunctions>{{ll|Extension:ParserFunctions}}</> to use the [[<tvar|ext-parserfunct-t>Special:MyLanguage/Help:Extension:ParserFunctions#.23time</>|#time parser function]]''. | ||
+ | |||
+ | === 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. | ||
+ | |||
+ | {| class="wikitable" | ||
|- | |- | ||
− | + | ! width="10%" | <!--T:66--> | |
+ | Variable | ||
+ | ! width="15%" | <!--T:67--> | ||
+ | Output | ||
+ | ! <!--T:68--> | ||
+ | Description | ||
+ | ! width="10%" | <!--T:69--> | ||
+ | Versions | ||
|- | |- | ||
− | + | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Site|SITENAME|SERVER|SERVERNAME|DIRMARK|DIRECTIONMARK}}{{Anchor|SCRIPTPATH|STYLEPATH|CURRENTVERSION|CONTENTLANGUAGE|CONTENTLANG}}<!--T:70--> | |
+ | Site | ||
|- | |- | ||
− | + | | <code><nowiki>{{SITENAME}}</nowiki></code> | |
+ | | {{SITENAME}} | ||
+ | | <!--T:71--> | ||
+ | The wiki's site name (<tvar|manual-wg-sitename>{{mediawiki|Special:MyLanguage/Manual:$wgSitename|$wgSitename}}</>). | ||
+ | | | ||
|- | |- | ||
− | + | | <code><nowiki>{{SERVER}}</nowiki></code> | |
+ | | {{SERVER}} | ||
+ | | <!--T:72--> | ||
+ | Domain [[w:URL|URL]] (<tvar|manual-wg-server>{{mediawiki|Special:MyLanguage/Manual:$wgServer|$wgServer}}</>). | ||
+ | | | ||
+ | |- | ||
+ | | <code><nowiki>{{SERVERNAME}}</nowiki></code> | ||
+ | | {{SERVERNAME}} | ||
+ | | <!--T:73--> | ||
+ | Subdomain and domain name (no longer dependent on <tvar|manual-wg-servername>{{mediawiki|Special:MyLanguage/Manual:$wgServerName|$wgServerName}}</> as of version 1.17). | ||
+ | | | ||
+ | |- | ||
+ | | <code><nowiki>{{DIRMARK}}</nowiki></code> <br /><code><nowiki>{{DIRECTIONMARK}}</nowiki></code> | ||
+ | | {{DIRMARK}} <br />{{DIRECTIONMARK}} | ||
+ | | <!--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 [[<tvar|manual-pagelang>Special:MyLanguage/Manual:Language#page-content-lang</>|page content language]]. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14442}} | ||
+ | |- | ||
+ | | <code><nowiki>{{SCRIPTPATH}}</nowiki></code> | ||
+ | | {{SCRIPTPATH}} | ||
+ | | <!--T:75--> | ||
+ | Relative script path (<tvar|manual-wg-scriptpath>{{mediawiki|Special:MyLanguage/Manual:$wgScriptPath|$wgScriptPath}}</>). | ||
+ | | | ||
+ | |- | ||
+ | | <code><nowiki>{{STYLEPATH}}</nowiki></code> | ||
+ | | {{STYLEPATH}} | ||
+ | | <!--T:76--> | ||
+ | Relative style path (<tvar|manual-wg-stylepath>{{mediawiki|Special:MyLanguage/Manual:$wgStylePath|$wgStylePath}}</>). | ||
+ | | {{ {{TNTN|MW version}} |version=1.16|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{CURRENTVERSION}}</nowiki></code> | ||
+ | | {{CURRENTVERSION}} | ||
+ | | <!--T:77--> | ||
+ | The wiki's MediaWiki version. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14199}} | ||
+ | |- | ||
+ | | <code><nowiki>{{CONTENTLANGUAGE}}</nowiki></code> <br /><code><nowiki>{{CONTENTLANG}}</nowiki></code> | ||
+ | | {{CONTENTLANGUAGE}} <br />{{CONTENTLANG}} | ||
+ | | <!--T:78--> | ||
+ | The wiki's default interface language (<tvar|manual-wg-langcode>{{mediawiki|Special:MyLanguage/Manual:$wgLanguageCode|$wgLanguageCode}}</>). | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14661}} | ||
+ | |- | ||
+ | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|Page|PAGEID|PROTECTIONLEVEL|CASCADINGSOURCES}}<!--T:79--> | ||
+ | Page | ||
+ | |- | ||
+ | | <code><nowiki>{{PAGEID}}</nowiki></code> | ||
+ | | {{PAGEID}} | ||
+ | | <!--T:80--> | ||
+ | Returns the page identifier. | ||
+ | | {{ {{TNTN|MW version}} |version=1.20|compact=y|comment=and after|gerrit change=9858}} | ||
+ | |- | ||
+ | | <code><nowiki>{{</nowiki>PROTECTIONLEVEL:<!--T:261--> | ||
+ | ''action''}}</code> | ||
+ | | <!-- Leave this empty. --> | ||
+ | | <!--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. | ||
+ | | {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=45587}} | ||
+ | |- style="background:#FED;" | ||
+ | | <code><nowiki>{{CASCADINGSOURCES}}</nowiki></code> | ||
+ | | <!-- Leave this empty. --> | ||
+ | | <!--T:291--> | ||
+ | '''[Expensive]''' Returns the sources of any cascading protection acting on the current page. Pages will not return their own title unless they transclude themselves. | ||
+ | | {{ {{TNTN|MW version}} |version=1.23|compact=y|comment=and after|gerrit change=104999}} | ||
+ | |- | ||
+ | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|revision|REVISIONID|REVISIONDAY|REVISIONDAY2|REVISIONMONTH|REVISIONMONTH1|REVISIONYEAR|REVISIONTIMESTAMP|REVISIONUSER}}<!--T:82--> | ||
+ | Latest revision to current page | ||
+ | |- | ||
+ | | <code><nowiki>{{REVISIONID}}</nowiki></code> | ||
+ | | {{REVISIONID}} | ||
+ | | <!--T:83--> | ||
+ | Unique revision ID. | ||
+ | | {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{REVISIONDAY}}</nowiki></code> | ||
+ | | {{REVISIONDAY}} | ||
+ | | <!--T:84--> | ||
+ | Day edit was made (unpadded number). | ||
+ | | {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{REVISIONDAY2}}</nowiki></code> | ||
+ | | {{REVISIONDAY2}} | ||
+ | | <!--T:85--> | ||
+ | Day edit was made (zero-padded number). | ||
+ | | {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{REVISIONMONTH}}</nowiki></code> | ||
+ | | {{REVISIONMONTH}} | ||
+ | | <!--T:86--> | ||
+ | Month edit was made (zero-padded number as of {{mediawiki|rev:66200|1.17+}}, unpadded number in prior versions). | ||
+ | | {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{REVISIONMONTH1}}</nowiki></code> | ||
+ | | {{REVISIONMONTH1}} | ||
+ | | <!--T:87--> | ||
+ | Month edit was made (unpadded number). | ||
+ | | {{ {{TNTN|MW version}} |version=1.17|compact=y|comment=and after|r=66200}} | ||
+ | |- | ||
+ | | <code><nowiki>{{REVISIONYEAR}}</nowiki></code> | ||
+ | | {{REVISIONYEAR}} | ||
+ | | <!--T:88--> | ||
+ | Year edit was made. | ||
+ | | {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{REVISIONTIMESTAMP}}</nowiki></code> | ||
+ | | {{REVISIONTIMESTAMP}} | ||
+ | | <!--T:89--> | ||
+ | Timestamp as of time of edit. | ||
+ | | {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{REVISIONUSER}}</nowiki></code> | ||
+ | | {{REVISIONUSER}} | ||
+ | | <!--T:90--> | ||
+ | The username of the user who made the most recent edit to the page, or the current user when previewing an edit. | ||
+ | | {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=48149}} | ||
+ | |- | ||
+ | | <code><nowiki>{{REVISIONSIZE}}</nowiki></code> | ||
+ | | {{REVISIONSIZE}} | ||
+ | | <!--T:91--> | ||
+ | The size (bytes of wikitext) of the current revision of this page | ||
+ | | {{ {{TNTN|MW version}} |version=1.22|compact=y|comment=and after|gerrit change=82650}} | ||
+ | |- | ||
+ | ! colspan="4" style="background-color: #DDDDDD;"| {{Anchor|DISPLAYTITLE|DEAFULTSORT|DEFAULTCATEGORYSORT|DEFAULTSORTKEY}}<!--T:92--> | ||
+ | Affects page content | ||
+ | |- | ||
+ | | {{anchor|Displaytitle}} <code><nowiki>{{DISPLAYTITLE:</nowiki><!--T:262--> | ||
+ | ''title''<nowiki>}}</nowiki></code> | ||
+ | | | ||
+ | | <!--T:93--> | ||
+ | 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 <tvar|manual-wg-restrict-disp-title>{{mediawiki|Special:MyLanguage/Manual:$wgRestrictDisplayTitle|$wgRestrictDisplayTitle}}</>). It can be disabled or enabled by <tvar|manual-wg-allow-disp-title>{{mediawiki|Special:MyLanguage/Manual:$wgAllowDisplayTitle|$wgAllowDisplayTitle}}</>; disabled by default before 1.10+, enabled by default thereafter. | ||
+ | <!--T:300--> | ||
+ | It can take a second argument of ''noerror'' or ''noreplace'' to suppress error messages when multiple displaytitles are used on one page or to make this <tt>displaytitle</tt> do nothing if a <tt>displaytitle</tt> was already specified earlier in the page. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}}<br/>{{ {{TNTN|MW version}} |version=1.24|compact=y|comment=and after|gerrit change=144870}} <br /> (<!--T:299--> | ||
+ | for noerror and noreplace) | ||
+ | |- | ||
+ | | {{anchor|Defaultsort}} <code><nowiki>{{DEFAULTSORT:</nowiki><!--T:263--> | ||
+ | ''sortkey''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{DEFAULTSORTKEY:</nowiki></>''sortkey''<tvar|code2><nowiki>}}</nowiki></code> <br /><code><nowiki>{{DEFAULTCATEGORYSORT:</nowiki></>''sortkey''<tvar|code3><nowiki>}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki></>''sortkey''<tvar|code4><nowiki>|noerror}}</nowiki></code> <br/><code><nowiki>{{DEFAULTSORT:</nowiki></>''sortkey''<nowiki>|noreplace}}</nowiki></code> | ||
+ | | | ||
+ | | <!--T:94--> | ||
+ | Used for categorizing pages, sets a default [[<tvar|help-categories>Special:MyLanguage/Help:Categories</>|category sort key]]. For example if you put <tvar|sort><code><nowiki>{{DEFAULTSORT:</>Smith , John<tvar|sort-end>}}</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 <tvar|sort2><tt>defaultsort</tt></> do nothing if a <tvar|sort3><tt>defaultsort</tt></> was already specified earlier in the page. | ||
+ | | {{ {{TNTN|MW version}} |version=1.10|compact=y|comment=and after}}<br/>{{ {{TNTN|MW version}} |version=1.19|compact=y|comment=and after|r=96767}} <br /> (<!--T:95--> | ||
+ | for noerror and noreplace) | ||
|} | |} | ||
− | === | + | |
+ | |||
+ | === 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, <tvar|nop-code><code><nowiki>{{NUMBEROFPAGES}}</nowiki></code></> → <tvar|nop-result>{{NUMBEROFPAGES}}</> and <tvar|nop-r-code><code><nowiki>{{NUMBEROFPAGES:R}}</nowiki></code></> → <tvar|nop-r-result>{{NUMBEROFPAGES:R}}</>). | ||
+ | |||
+ | <!--T:98--> | ||
+ | Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example <tvar|pic><code><nowiki>{{PAGESINCATEGORY:Help}}</nowiki></code></> and <tvar|pic-r><code><nowiki>{{PAGESINCATEGORY:Help|R}}</nowiki></code></>, or <tvar|pic-subcats><code><nowiki>{{PAGESINCATEGORY:Help|subcats}}</nowiki></code></> and <tvar|pic-subcats-r><code><nowiki>{{PAGESINCATEGORY:Help|subcats|R}}</nowiki></code></>). Also applicable to <tvar|pagesize><code><nowiki>{{PAGESIZE:</nowiki></>''page name''<tvar|pagesize-end><nowiki>}}</nowiki></code></> hereinbefore. | ||
+ | |||
+ | <!--T:99--> | ||
+ | The number magic words are formatted in the wiki content language. Since {{r|94680|1.19}}, it depends on the [[<tvar|manual-pagelang>Special:MyLanguage/Manual:Language#page-content-lang</>|page content language]]. | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | |- |
− | ! | + | ! width="10%" | <!--T:100--> |
− | ! | + | Variable |
− | |- | + | ! width="10%" | <!--T:101--> |
+ | Output | ||
+ | ! <!--T:102--> | ||
+ | Description | ||
+ | ! width="10%" | <!--T:103--> | ||
+ | Versions | ||
+ | |- | ||
+ | | <code><nowiki>{{NUMBEROFPAGES}}</nowiki></code> | ||
+ | | {{NUMBEROFPAGES}} | ||
+ | | {{Anchor|NUMBEROFPAGES}}<!--T:104--> | ||
+ | Number of wiki pages. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code> | ||
+ | | {{NUMBEROFARTICLES}} | ||
+ | | {{Anchor|NUMBEROFARTICLES}}<!--T:105--> | ||
+ | Number of pages in {{mediawiki|<tvar|manual-content-ns>Special:MyLanguage/Manual:Using custom namespaces#content-ns</>|content namespaces}}. | ||
| | | | ||
− | {| | + | |- |
− | | | + | | <code><nowiki>{{NUMBEROFFILES}}</nowiki></code> |
− | + | | {{NUMBEROFFILES}} | |
− | + | | {{Anchor|NUMBEROFFILES}}<!--T:106--> | |
− | + | Number of uploaded files. | |
− | + | | {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}} | |
− | + | |- | |
− | + | | <code><nowiki>{{NUMBEROFEDITS}}</nowiki></code> | |
− | + | | {{NUMBEROFEDITS}} | |
− | + | | {{Anchor|NUMBEROFEDITS}}<!--T:107--> | |
− | + | Number of wiki edits. | |
− | + | | {{ {{TNTN|MW version}} |version=1.10|compact=y|comment=and after|r=21319}} | |
− | + | |- | |
− | + | | <code><nowiki>{{NUMBEROFVIEWS}}</nowiki></code> | |
− | | '' | + | | |
− | + | | {{Anchor|NUMBEROFVIEWS}}<!--T:108--> | |
− | + | Number of page views. Usually useless on a wiki using [[<tvar|manual-cache>Special:MyLanguage/Manual:Cache</>|caching]]. <!--T:303--> | |
− | + | Removed in <tvar|gerrit>{{gerrit|150699}}</>. | |
− | * {{ | + | | {{ {{TNTN|MW version}} |version=1.14|compact=y|version2=1.24|r=42721}} |
− | + | |- | |
− | + | | <code><nowiki>{{NUMBEROFUSERS}}</nowiki></code> | |
− | + | | {{NUMBEROFUSERS}} | |
− | + | | {{Anchor|NUMBEROFUSERS}}<!--T:109--> | |
− | + | Number of registered users. | |
− | + | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | |
− | + | |- | |
− | + | | <code><nowiki>{{NUMBEROFADMINS}}</nowiki></code> | |
+ | | {{NUMBEROFADMINS}} | ||
+ | | {{Anchor|NUMBEROFADMINS}}<!--T:110--> | ||
+ | Number of users in the ''sysop'' {{mediawiki|<tvar|manual-userrights>Special:MyLanguage/Manual:User rights</>|group}}. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | <code><nowiki>{{NUMBEROFACTIVEUSERS}}</nowiki></code> | ||
+ | | {{NUMBEROFACTIVEUSERS}} | ||
+ | | {{Anchor|NUMBEROFACTIVEUSERS}}<!--T:111--> | ||
+ | Number of active users, based on the criteria used in [[Special:Statistics]]. | ||
+ | | {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=47392}} | ||
+ | |- style="background:#FED;" | ||
+ | | {{Anchor|PAGESINCATEGORY|PAGESINCAT}}<code><nowiki>{{PAGESINCATEGORY:</nowiki>''categoryname''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINCAT:</nowiki>''categoryname''<nowiki>}}</nowiki></code> | ||
+ | | {{PAGESINCATEGORY:Help}} <br />{{PAGESINCAT:Help}} | ||
+ | | <!--T:112--> | ||
+ | '''[Expensive]''' Number of pages (including subcategories and files) in the given [[<tvar|help-categories>Special:MyLanguage/Help:Categories</>|category]]. <small>([[:Category:Help]] used for demonstration)</small> | ||
+ | | {{ {{TNTN|MW version}} |version=1.13|compact=y|comment=and after|r=32932}} | ||
+ | |- style="background:#FED;" | ||
+ | | <code><nowiki>{{PAGESINCATEGORY:</nowiki><!--T:264--> | ||
+ | ''categoryname''<tvar|code1><nowiki>|all}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki></>''categoryname''<tvar|code2><nowiki>|pages}}</nowiki></code> <br /><code><nowiki>{{PAGESINCATEGORY:</nowiki></>''categoryname''<tvar|code3><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}} | ||
+ | | <!--T:113--> | ||
+ | '''[Expensive]''' Respectively, the number of | ||
+ | * all pages | ||
+ | * ordinary pages (excluding subcategories and files) | ||
+ | * subcategories or | ||
+ | * files | ||
+ | in the given [[<tvar|help-categories>Special:MyLanguage/Help:Categories</>|category]]. <small>([[:Category:Help]] used for demonstration)</small> | ||
+ | | {{ {{TNTN|MW version}} |version=1.20|compact=y|comment=and after|gerrit change=12790}} | ||
+ | |- | ||
+ | | <code><nowiki>{{NUMBERINGROUP:</nowiki><!--T:265--> | ||
+ | ''groupname''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{NUMINGROUP:</nowiki></>''groupname''<nowiki>}}</nowiki></code> | ||
+ | | {{Anchor|NUMBERINGROUP|NUMINGROUP}}{{NUMBERINGROUP:bureaucrat}} <br />{{NUMINGROUP:bureaucrat}} <br /><small><nowiki>({{NUMBERINGROUP:bureaucrat}} used here)</nowiki></small> | ||
+ | | <!--T:114--> | ||
+ | Number of users in a specific {{mediawiki|<tvar|manual-userrights>Special:MyLanguage/Manual:User rights</>|group}}. | ||
+ | | {{ {{TNTN|MW version}} |version=1.14|compact=y|comment=and after|r=40116}} | ||
+ | |- style="background:#FED;" | ||
+ | | <code><nowiki>{{PAGESINNS:</nowiki><!--T:266--> | ||
+ | ''index''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{PAGESINNAMESPACE:</nowiki></>''index''<nowiki>}}</nowiki></code> | ||
+ | | <!--T:115--> | ||
+ | ''Not enabled'' | ||
+ | | {{Anchor|PAGESINNS|PAGESINNAMESPACE}}<!--T:116--> | ||
+ | '''[Expensive]''' Number of pages in the given [[<tvar|help-ns>Special:MyLanguage/Help:Namespaces</>|namespace]] (replace ''index'' with the relevant [[<tvar|manual-ns>Special:MyLanguage/Manual:Namespace</>|namespace index]]). For instance, <tvar|pins14><code><nowiki>{{PAGESINNAMESPACE:</nowiki>''14''<nowiki>}}</nowiki></code></> will output the number of category pages. <tvar|pins0><code><nowiki>{{PAGESINNS:0}}</nowiki></code></> differs from <tvar|noa><code><nowiki>{{NUMBEROFARTICLES}}</nowiki></code></> in that the former includes redirects and disambiguation pages. Disabled by default, enable with <tvar|manual-wg-allow-slow-parser-funct>{{mediawiki|Special:MyLanguage/Manual:$wgAllowSlowParserFunctions|$wgAllowSlowParserFunctions}}</>. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
|} | |} | ||
+ | |||
+ | {{Anchor|Page-names|Page names}} | ||
+ | |||
+ | === Page names === <!--T:117--> | ||
+ | |||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! width="10%" | <!--T:118--> | ||
+ | Variable | ||
+ | ! width="10%" | <!--T:119--> | ||
+ | Output | ||
+ | ! <!--T:120--> | ||
+ | Description | ||
+ | ! width="10%" | <!--T:121--> | ||
+ | Versions | ||
+ | |- | ||
+ | | {{Anchor|FULLPAGENAME|fullpagename}}<code><nowiki>{{FULLPAGENAME}}</nowiki></code> | ||
+ | | {{FULLPAGENAME}} | ||
+ | | <!--T:122--> | ||
+ | Namespace and full page title (including all subpage levels). | ||
+ | | {{ {{TNTN|MW version}} |version=1.6|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | {{Anchor|PAGENAME|pagename}}<code><nowiki>{{PAGENAME}}</nowiki></code> | ||
+ | | {{PAGENAME}} | ||
+ | | <!--T:123--> | ||
+ | Full page title (including all subpage levels) without the namespace. | ||
| | | | ||
− | + | |- | |
− | + | | <code><nowiki>{{BASEPAGENAME}}</nowiki></code> | |
− | + | | {{BASEPAGENAME}} | |
− | + | | {{Anchor|BASEPAGENAME|basepagename}}<!--T:124--> | |
− | + | Page title of the page in the immediately superior [[<tvar|help-subpages>Special:MyLanguage/Help:Subpages</>|subpage]] level without the namespace ("Title/foo" on "Help:Title/foo/bar"). | |
− | + | ||
− | + | <!--T:260--> | |
− | | | + | For more complex splitting, use <tvar|help-ext-pf-titleparts><code><nowiki>{{</nowiki>[[Special:MyLanguage/Help:Extension:ParserFunctions#.23titleparts|#titleparts:]]<nowiki>}}</nowiki></code></> from the [[<tvar|help-ext-pf>Special:MyLanguage/Help:Extension:ParserFunctions</>|ParserFunctions extension]]. |
− | + | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | |
− | + | |- | |
− | + | | {{Anchor|SUBPAGENAME|subpagename}}<code><nowiki>{{SUBPAGENAME}}</nowiki></code> | |
− | + | | {{SUBPAGENAME}} | |
− | + | | <!--T:125--> | |
− | + | The [[<tvar|help-subpages>Special:MyLanguage/Help:Subpages</>|subpage]] title ("bar" on "Help:Title/foo/bar"). | |
− | + | | {{ {{TNTN|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> | ||
+ | | {{SUBJECTPAGENAME}}<br/>{{ARTICLEPAGENAME}} | ||
+ | | <!--T:126--> | ||
+ | Full page name of the associated subject (e.g. article or file). Useful on talk pages. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | {{Anchor|TALKPAGENAME|talkpagename}}<code><nowiki>{{TALKPAGENAME}}</nowiki></code> | ||
+ | | {{TALKPAGENAME}} | ||
+ | | <!--T:127--> | ||
+ | Full page name of the associated talk page. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | {{Anchor|ROOTPAGENAME|rootpagename}}<code><nowiki>{{ROOTPAGENAME}}</nowiki></code> | ||
+ | | {{ROOTPAGENAME}} | ||
+ | | <!--T:301--> | ||
+ | Name of the root of the current page. <!--T:302--> | ||
+ | Would return <tvar|foo><code>Title</code></> on page <tvar|baz><code>Help:Title/Foo/Bar</code></> | ||
+ | | {{ {{TNTN|MW version}} |version=1.22|compact=y|comment=and after}} | ||
|} | |} | ||
− | |||
− | + | <!--T:128--> | |
− | : ''For | + | The <tvar|basepagename><code><nowiki>{{BASEPAGENAME}}</nowiki></code></> and <tvar|subpagename><code><nowiki>{{SUBPAGENAME}}</nowiki></code></> magic words only work in namespaces that have subpages enabled. See <tvar|manual-wg-ns-with-subpages>{{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: | ||
+ | * <tvar|code><code><nowiki>{{PAGENAME:Template:Main Page}}</nowiki></code></> → '''<tvar|result>{{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. <tvar|pic><code><nowiki>{{PAGESINCATEGORY:{{PAGENAME}}}}</nowiki></code></>. See bugs {{mediawiki|phabricator:T16779|T16779}}, {{mediawiki|phabricator:T18474|T18474}}, {{mediawiki|phabricator:T37628|T37628}}, and {{mediawiki|phabricator:T37746|T37746}}. One simple way to fix this is wrapping the pagename in #titleparts (parser function).}} | ||
+ | |||
+ | <!--T:131--> | ||
+ | For example, if page name is "<tvar|pagename>L'Aquila</>", the following code will produce the string "<tvar|result>Numeric char encoding</>": | ||
+ | |||
+ | <pre><nowiki>{{#switch:{{PAGENAME}} | ||
+ | | L'Aquila = No translation | ||
+ | | L = Not OK | ||
+ | | L&apos;Aquila = Entity escaping | ||
+ | | L&#39;Aquila = Numeric char encoding | ||
+ | }}</nowiki></pre> | ||
+ | |||
+ | |||
+ | ==== 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]]): | ||
+ | |||
+ | * <code><nowiki>{{FULLPAGENAMEE}}</nowiki> | ||
+ | * <nowiki>{{PAGENAMEE}}</nowiki> | ||
+ | * <nowiki>{{BASEPAGENAMEE}}</nowiki> | ||
+ | * <nowiki>{{SUBPAGENAMEE}}</nowiki> | ||
+ | * <nowiki>{{SUBJECTPAGENAMEE}}</nowiki> | ||
+ | * <nowiki>{{ARTICLEPAGENAMEE}}</nowiki> | ||
+ | * <nowiki>{{TALKPAGENAMEE}}</nowiki> | ||
+ | * <nowiki>{{ROOTPAGENAMEE}}</nowiki></code> | ||
+ | |||
+ | <!--T:135--> | ||
+ | Note that <tvar|pagename><code><nowiki>{{PAGENAME:...}}</nowiki></code></>, <tvar|pagenamee><code><nowiki>{{PAGENAMEE:...}}</nowiki></code></> and <tvar|uec><code><nowiki>{{urlencode:...}}</nowiki></code></> have distinct implementations. See [[<tvar|manual-pagename-encoding>Special:MyLanguage/Manual:PAGENAMEE encoding</>|Manual:PAGENAMEE encoding]] for details. | ||
+ | |||
+ | |||
+ | {{anchor|Namespaces}} | ||
+ | |||
+ | |||
+ | === Namespaces === <!--T:136--> | ||
+ | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
− | |||
− | |||
|- | |- | ||
− | + | ! <!--T:137--> | |
− | + | Variable | |
+ | ! <!--T:138--> | ||
+ | Output | ||
+ | ! <!--T:139--> | ||
+ | Description | ||
+ | ! <!--T:140--> | ||
+ | Versions | ||
|- | |- | ||
− | + | | <code><nowiki>{{NAMESPACE}}</nowiki></code> | |
− | + | | {{NAMESPACE}} | |
+ | | <!--T:141--> | ||
+ | Name of the page's namespace | ||
+ | | | ||
|- | |- | ||
− | | {{ | + | | <code><nowiki>{{NAMESPACENUMBER}}</nowiki></code> |
− | | [[ | + | | {{NAMESPACENUMBER}} |
+ | | <!--T:142--> | ||
+ | [[<tvar|manual-ns-id>Special:MyLanguage/Manual:Namespace#Built-in_namespaces</>|ID]] of the page's namespace | ||
+ | | {{ {{TNTN|MW version}} |version=1.20|compact=y|comment=and after|gerrit change=4056}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{SUBJECTSPACE}}</nowiki></code> <br /><code><nowiki>{{ARTICLESPACE}}</nowiki></code> | |
− | + | | {{SUBJECTSPACE}} <br />{{ARTICLESPACE}} | |
+ | | <!--T:143--> | ||
+ | Name of the associated content namespace | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{TALKSPACE}}</nowiki></code> | |
− | + | | {{TALKSPACE}} | |
+ | | <!--T:144--> | ||
+ | Name of the associated talk namespace | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
+ | |} | ||
+ | |||
+ | <!--T:145--> | ||
+ | The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded): | ||
+ | |||
+ | * <code><nowiki>{{NAMESPACEE}}</nowiki></code> | ||
+ | * <code><nowiki>{{SUBJECTSPACEE}}</nowiki></code> | ||
+ | * <code><nowiki>{{ARTICLESPACEE}}</nowiki></code> | ||
+ | * <code><nowiki>{{TALKSPACEE}}</nowiki></code> | ||
+ | |||
+ | <!--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: | ||
+ | |||
+ | * <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>{{TALKSPACE:Template:Main Page}}</nowiki></code> → '''{{TALKSPACE:Template:Main Page}}''' | ||
+ | <!--T:147--> | ||
+ | Parameter must not be a namespace name: | ||
+ | * <code><nowiki>{{SUBJECTSPACE:Help talk}}</nowiki></code> → '''{{SUBJECTSPACE:Help talk}}<!-- empty --> ''' (''Empty'') | ||
+ | |||
+ | |||
+ | === Other === <!--T:293--> | ||
+ | |||
+ | {| class="wikitable" | ||
|- | |- | ||
− | + | ! <!--T:294--> | |
− | + | Variable | |
+ | ! <!--T:295--> | ||
+ | Output | ||
+ | ! <!--T:296--> | ||
+ | Description | ||
+ | ! <!--T:297--> | ||
+ | Versions | ||
+ | |- | ||
+ | | <code><nowiki>{{!}}</nowiki></code> | ||
+ | |style="text-align:center;"| <nowiki>|</nowiki> | ||
+ | | {{Anchor|PIPE|Pipe|pipe|.7C|.7c}}<!--T:298--> | ||
+ | Used to include a pipe character as part of a template argument or table cell contents. Before this was added as a magic word, many wikis implemented this by creating [[Template:!]] with <code><nowiki>|</nowiki></code> as the content. | ||
+ | | {{ {{TNTN|MW version}} |version=1.24|compact=y|comment=and after|gerrit change=136234}} | ||
|} | |} | ||
− | |||
− | === | + | {{anchor|Parser functions}} |
+ | |||
+ | == 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. | ||
+ | |||
+ | <!--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 <tvar|ext-pf>{{ll|Extension:ParserFunctions}}</>. For those see <tvar|help-ext-pf>{{ll|Help:Extension:ParserFunctions}}</>. | ||
+ | |||
+ | |||
+ | === URL data === <!--T:169--> | ||
+ | |||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
− | |||
− | |||
|- | |- | ||
− | + | ! <!--T:170--> | |
− | + | Parser function | |
+ | ! <!--T:171--> | ||
+ | Input → Output | ||
+ | ! <!--T:172--> | ||
+ | Description | ||
+ | ! <!--T:173--> | ||
+ | Versions | ||
|- | |- | ||
− | + | | colspan="4"| {{Anchor|localurl|LOCALURL}} | |
− | + | ||
|- | |- | ||
− | + | | <code><nowiki>{{localurl:</nowiki><!--T:279--> | |
− | + | ''page name''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{localurl:</nowiki></>''page name''<br /><tvar|code2><nowiki>|</nowiki></>''query_string''<nowiki>}}</nowiki></code> | |
+ | | <code><nowiki>{{localurl:MediaWiki}}</nowiki></code><br />→ {{localurl:MediaWiki}} <br /><code><nowiki>{{localurl:MediaWiki|printable=yes}}</nowiki></code><br />→ {{localurl:MediaWiki|printable=yes}} | ||
+ | | <!--T:174--> | ||
+ | The relative path to the title. | ||
+ | | | ||
|- | |- | ||
− | + | | colspan="4"| {{Anchor|fullurl|FULLURL}} | |
− | + | ||
|- | |- | ||
− | + | | <code><nowiki>{{fullurl:</nowiki><!--T:280--> | |
− | + | ''page name''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{fullurl:</nowiki></>''page name''<tvar|code2><br /><nowiki>|</nowiki></>''query_string''<tvar|code3><nowiki>}}</nowiki></code> <br /><code><nowiki>{{fullurl:</nowiki></>''interwiki:remote page name''<tvar|code4><br /><nowiki>|</nowiki></>''query_string''<nowiki>}}</nowiki></code> | |
+ | | <code><nowiki>{{fullurl:Category:Top level}}</nowiki></code><br />→ {{fullurl:Category:Top level}} <br /> | ||
+ | <code><nowiki>{{fullurl:Category:Top level|action=edit}}</nowiki></code><br />→ {{fullurl:Category:Top level|action=edit}}<br /> | ||
+ | <code><nowiki>https:{{fullurl:s:Electra|action=edit}}</nowiki></code><br />→ https:{{fullurl:s:Electra|action=edit}}<br /> | ||
+ | <code><nowiki>https:{{fullurl:s:es:Electra|action=edit}}</nowiki></code><br />→ https:{{fullurl:s:es:Electra|action=edit}} | ||
+ | | <!--T:175--> | ||
+ | A protocol-relative path to the title. This will also resolve [[<tvar|manual-interwiki>Special:MyLanguage/Manual:Interwiki</>|interwiki]] prefixes. '''Note:''' Unbracketed (plain) protocol-relative links are not automagically linked. | ||
+ | | {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | | colspan="4"| {{Anchor|canonicalurl|CANONICALURL}} | |
− | + | ||
|- | |- | ||
− | + | | <code><nowiki>{{canonicalurl:</nowiki><!--T:281--> | |
− | + | ''page name''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{canonicalurl:</nowiki></>''page name''<tvar|code2><br /><nowiki>|</nowiki></>''query_string''<tvar|code3><nowiki>}}</nowiki></code> <br /><code><nowiki>{{canonicalurl:</nowiki></>''interwiki:remote page name''<tvar|code4><br /><nowiki>|</nowiki></>''query_string''<nowiki>}}</nowiki></code> | |
+ | | <code><nowiki>{{canonicalurl:Category:Top level}}</nowiki></code><br />→ {{canonicalurl:Category:Top level}} <br /> | ||
+ | <code><nowiki>{{canonicalurl:Category:Top level|action=edit}}</nowiki></code><br />→ {{canonicalurl:Category:Top level|action=edit}} | ||
+ | | <!--T:176--> | ||
+ | The absolute path to the title, using the canonical URL. This will also resolve [[<tvar|manual-interwiki>Special:MyLanguage/Manual:Interwiki</>|interwiki]] prefixes. | ||
+ | | {{ {{TNTN|MW version}} |version=1.18|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | | colspan="4"| {{Anchor|filepath|FILEPATH}} | |
− | + | ||
|- | |- | ||
− | + | | <code><nowiki>{{filepath:</nowiki><!--T:282--> | |
− | + | ''file name''<tvar|code1><nowiki>}}</nowiki></code> <br /><code><nowiki>{{filepath:</nowiki></>''file name''<tvar|code2><nowiki>|nowiki}}</nowiki></code> <br /><code><nowiki>{{filepath:</nowiki></>''file name''<tvar|code3><nowiki>|</nowiki></>''thumbnail_size''<nowiki>}}</nowiki></code> | |
+ | | <code><nowiki>{{filepath:Wiki.png}}</nowiki></code><br />→ {{filepath:Wiki.png}} <br /> | ||
+ | <code><nowiki>{{filepath:Wiki.png|nowiki}}</nowiki></code><br />→ {{filepath:Wiki.png|nowiki}} <br /> | ||
+ | <code><nowiki>{{filepath:Example.svg|300}}</nowiki></code><br />→ {{filepath:Example.svg|300}} <br /> | ||
+ | | <!--T:177--> | ||
+ | A protocol-relative path to the full size or thumbnail ({{mediawiki|rev:80813|1.18+}}) of a media file. | ||
+ | | {{ {{TNTN|MW version}} |version=1.12|compact=y|comment=and after|r=25854}} <br />{{ {{TNTN|MW version}} |version=1.18|compact=y|comment=and after|r=80813}} | ||
|- | |- | ||
− | + | | colspan="4"| {{Anchor|urlencode|URLENCODE}} | |
− | + | ||
|- | |- | ||
− | + | | <code><nowiki>{{urlencode:</nowiki><!--T:283--> | |
− | + | ''string''<tvar|code1><nowiki>}}</nowiki></code></> or <br /><tvar|code2><code><nowiki>{{urlencode:</nowiki></>''string''<tvar|code3><nowiki>|QUERY}}</nowiki></code></> <tvar|code4><br /><code><nowiki>{{urlencode:</nowiki></>''string''<tvar|code5><nowiki>|WIKI}}</nowiki></code> <br /><code><nowiki>{{urlencode:</nowiki></>''string''<nowiki>|PATH}}</nowiki></code> | |
+ | | <code><nowiki>{{urlencode:x:y/z á é}}</nowiki></code> or <br /><code><nowiki>{{urlencode:x:y/z á é|QUERY}}</nowiki></code><br />→ {{urlencode:x:y/z á é}} <br /><code><nowiki>{{urlencode:x:y/z á é|WIKI}}</nowiki></code><br />→ {{urlencode:x:y/z á é|WIKI}} <br /><code><nowiki>{{urlencode:x:y/z á é|PATH}}</nowiki></code><br />→ {{urlencode:x:y/z á é|PATH}} | ||
+ | <!--T:178--> | ||
+ | Note that the default changed from <tvar|wiki><code>|WIKI</code></> to <tvar|query><code>|QUERY</code></> in 1.17; this may break templates that rely on this function. | ||
+ | | <!--T:179--> | ||
+ | The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete <tvar|ext-stringfunctions>{{ll|Extension:StringFunctions}}</>.<br /><table class="wikitable"><caption><!--T:305--> | ||
+ | Encoding</caption><tr><th><!--T:306--> | ||
+ | code</th><th><!--T:307--> | ||
+ | space</th></tr><tr><td> ''none''</td><td><samp> + </samp></td></tr><tr><td><kbd>QUERY</kbd></td><td><samp> + </samp></td></tr><tr><td><kbd> WIKI</kbd></td><td><samp> _ </samp></td></tr><tr><td><kbd> PATH</kbd></td><td><samp>%20</samp></td></tr></table> | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14273}} (or {{ {{TNTN|MW version}} |version=1.17|compact=y|comment=and after|r=64726}} <br />{{ {{TNTN|MW version}} |version=1.17|compact=y|comment=and after|r=64726}} <br />{{ {{TNTN|MW version}} |version=1.17|compact=y|comment=and after|r=64726}}) | ||
+ | |- | ||
+ | | colspan="4"| {{Anchor|anchorencode|ANCHORENCODE}} | ||
+ | |- | ||
+ | | <code><nowiki>{{anchorencode:</nowiki><!--T:284--> | ||
+ | ''string''<nowiki>}}</nowiki></code> | ||
+ | | <code><nowiki>{{anchorencode:x y z á é}}</nowiki></code><br />→ {{anchorencode:x y z á é}} | ||
+ | | <!--T:180--> | ||
+ | The input encoded for use in URL section anchors (after the “#” symbol in a URL). | ||
+ | | {{ {{TNTN|MW version}} |version=1.6|compact=y|comment=and after|r=16279}} | ||
|} | |} | ||
− | === | + | {{anchor|Namespaces_2}} |
+ | |||
+ | === Namespaces === <!--T:181--> | ||
+ | |||
+ | <!--T:182--> | ||
+ | <tvar|ns><code><nowiki>{{ns:}}</nowiki></code></> returns the current localized name for the [[<tvar|help-ns>Special:MyLanguage/Help:Namespace</>|namespace]] with that index, canonical name, or local alias. Thus <tvar|ns6><code><nowiki>{{ns:6}}</nowiki></code></>, <tvar|ns-file><code><nowiki>{{ns:File}}</nowiki></code></>, and <tvar|ns-img><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, <tvar|ns-file-de><code><nowiki>{{ns:Fichier}}</nowiki></code></> is also valid, but <tvar|ns-file-incorrect><code><nowiki>{{ns:Datei}}</nowiki></code></> (the localisation of "File" in German) is not. | ||
+ | |||
+ | <!--T:183--> | ||
+ | <tvar|nse><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. | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
− | |||
− | |||
|- | |- | ||
− | + | ! colspan="2" width="50%" | <!--T:258--> | |
− | + | Content namespaces | |
+ | ! rowspan="11" | | ||
+ | ! colspan="2" width=%50%" | <!--T:259--> | ||
+ | Talk namespaces | ||
|- | |- | ||
− | + | ! <!--T:184--> | |
− | + | Usage | |
+ | ! <!--T:185--> | ||
+ | Output | ||
+ | ! <!--T:186--> | ||
+ | Usage | ||
+ | ! <!--T:187--> | ||
+ | Output | ||
|- | |- | ||
− | + | | <code><nowiki>{{ns:-2}}</nowiki></code> / <code><nowiki>{{ns:Media}}</nowiki></code> | |
− | + | | {{ns:-2}} | |
+ | | <code><nowiki>{{ns:-1}}</nowiki></code> / <code><nowiki>{{ns:Special}}</nowiki></code> | ||
+ | | {{ns:-1}}<br/>''(no '''talk''' page)'' | ||
|- | |- | ||
− | + | | <code><nowiki>{{ns:0}}</nowiki></code> / <code><nowiki>{{ns:}}</nowiki></code> | |
− | + | | {{ns:0}} | |
+ | | <code><nowiki>{{ns:1}}</nowiki></code> / <code><nowiki>{{ns:Talk}}</nowiki></code> | ||
+ | | {{ns:1}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{ns:2}}</nowiki></code> / <code><nowiki>{{ns:User}}</nowiki></code> | |
− | + | | {{ns:2}} | |
+ | | <code><nowiki>{{ns:3}}</nowiki></code> / <code><nowiki>{{ns:User talk}}</nowiki></code> | ||
+ | | {{ns:3}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{ns:4}}</nowiki></code> / <code><nowiki>{{ns:Project}}</nowiki></code> | |
− | + | | {{ns:4}} <br/>''Varies between wikis'' | |
+ | | <code><nowiki>{{ns:5}}</nowiki></code> / <code><nowiki>{{ns:Project talk}}</nowiki></code> | ||
+ | | {{ns:5}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{ns:6}}</nowiki></code> / <code><nowiki>{{ns:File}}</nowiki></code> or <code><nowiki>{{ns:Image}}</nowiki></code> | |
− | + | | {{ns:6}} | |
+ | | <code><nowiki>{{ns:7}}</nowiki></code> / <code><nowiki>{{ns:File talk}}</nowiki></code> or <code><nowiki>{{ns:Image talk}}</nowiki></code> | ||
+ | | {{ns:7}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{ns:8}}</nowiki></code> / <code><nowiki>{{ns:MediaWiki}}</nowiki></code> | |
− | + | | {{ns:8}} | |
+ | | <code><nowiki>{{ns:9}}</nowiki></code> / <code><nowiki>{{ns:MediaWiki talk}}</nowiki></code> | ||
+ | | {{ns:9}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{ns:10}}</nowiki></code> / <code><nowiki>{{ns:Template}}</nowiki></code> | |
− | + | | {{ns:10}} | |
+ | | <code><nowiki>{{ns:11}}</nowiki></code> / <code><nowiki>{{ns:Template talk}}</nowiki></code> | ||
+ | | {{ns:11}} | ||
+ | |- | ||
+ | | <code><nowiki>{{ns:12}}</nowiki></code> / <code><nowiki>{{ns:Help}}</nowiki></code> | ||
+ | | {{ns:12}} | ||
+ | | <code><nowiki>{{ns:13}}</nowiki></code> / <code><nowiki>{{ns:Help talk}}</nowiki></code> | ||
+ | | {{ns:13}} | ||
+ | |- | ||
+ | | <code><nowiki>{{ns:14}}</nowiki></code> / <code><nowiki>{{ns:Category}}</nowiki></code> | ||
+ | | {{ns:14}} | ||
+ | | <code><nowiki>{{ns:15}}</nowiki></code> / <code><nowiki>{{ns:Category talk}}</nowiki></code> | ||
+ | | {{ns:15}} | ||
|} | |} | ||
− | + | <!--T:188--> | |
− | + | Don't confuse localised namespaces with [[<tvar|manual-custom-ns>Special:MyLanguage/Manual:Using custom namespaces</>|custom namespaces]]. | |
+ | |||
+ | {{anchor|Formatting}} | ||
+ | |||
+ | === Formatting === <!--T:189--> | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
− | ! | + | ! width="10%" | <!--T:190--> |
− | ! | + | Usage |
+ | ! width="40%" | <!--T:191--> | ||
+ | Input → Output | ||
+ | ! <!--T:192--> | ||
+ | Description | ||
+ | ! width="10%" | <!--T:193--> | ||
+ | Version | ||
|- | |- | ||
− | + | | <code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>}}</nowiki></code> <br /> | |
− | + | <code><nowiki>{{formatnum:</nowiki>''formatnum-formatted number''<nowiki>|R}}</nowiki></code> <br /> | |
+ | <code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>|NOSEP}}</nowiki></code> | ||
+ | | | ||
+ | * <!--T:194--> | ||
+ | Simple: | ||
+ | ** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → {{formatnum:987654321.654321}} | ||
+ | ** <code><nowiki>{{formatnum:</nowiki>{{formatnum:987654321.654321}}<nowiki>|R}}</nowiki></code> <br/> → {{formatnum:{{formatnum:987654321.654321}}|R}} | ||
+ | * <!--T:195--> | ||
+ | Advanced: | ||
+ | ** <code><nowiki>{{formatnum:{{formatnum:987654321.654321}}|R}}</nowiki></code> <br/> → {{formatnum:{{formatnum:987654321.654321}}|R}} <!--T:196--> | ||
+ | (on any locale) | ||
+ | ** <code><nowiki>{{formatnum:00001}}</nowiki></code> <br/> → {{formatnum:00001}} | ||
+ | ** <code><nowiki>{{formatnum:987654321.654321 |NOSEP}}</nowiki></code> <br/> → {{formatnum:987654321.654321 |NOSEP}} | ||
+ | ** <!--T:197--> | ||
+ | Examples with [[w:Bengali numerals|{{#language:bn|en}} locale]]: | ||
+ | *** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → ৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১ | ||
+ | *** <code><nowiki>{{formatnum:987654321.654321 |NOSEP}}</nowiki></code> <br/> → ৯৮৭৬৫৪৩২১.৬৫৪৩২১ | ||
+ | *** <code><nowiki>{{formatnum:৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১ |R}}</nowiki></code> <br/> → 987654321.654321 | ||
+ | ---- | ||
+ | <!--T:198--> | ||
+ | Unsupported: <br /> | ||
+ | <code><nowiki>{{formatnum:{{formatnum:987.654.321}}}}</nowiki></code> <br/> → 987 654 321 <!--T:199--> | ||
+ | (e.g. with Italian locale) | ||
+ | ---- | ||
+ | <!--T:200--> | ||
+ | Examples of wrong input (unreliable output), with or without <code>|R</code>: <br /> | ||
+ | <code><nowiki>{{formatnum:987,654.321|R}}</nowiki></code> <!--T:201--> | ||
+ | (the least broken) <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> | ||
+ | | <!--T:202--> | ||
+ | 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 /> | ||
+ | The <code><nowiki>|R</nowiki></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 which are known to be formatted exactly as formatnum formats them with the wiki's locale.<br/> | ||
+ | <!--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. | ||
+ | |||
+ | <small>{{TNT|warning}} <!--T:203--> | ||
+ | Leading zeroes are not removed, you can use <nowiki>{{#expr:00001}}</nowiki> instead if you have <tvar|ext-pf>{{ll|Extension:ParserFunctions}}</> installed.</small> <br/> | ||
+ | |||
+ | <small>{{TNT|warning}} <!--T:204--> | ||
+ | If you don't input numbers in the exact format required, don't expect any reliable output, especially on non-English wikis.</small><br/> | ||
+ | ---- | ||
+ | |||
+ | <!--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). Be aware that this is more a hack than a regular way to proceed, thus the output may be not reliable. | ||
+ | |||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} <br />{{ {{TNTN|MW version}} |version=1.13|compact=y|comment=and after|r=32012}} | ||
|- | |- | ||
− | + | | | |
− | + | <code><nowiki>{{#dateformat:</nowiki>''date''<nowiki>}}</nowiki></code><br /> | |
+ | <code><nowiki>{{#formatdate:</nowiki>''date''<nowiki>}}</nowiki></code><br /> | ||
+ | <code><nowiki>{{#dateformat:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code><br /> | ||
+ | <code><nowiki>{{#formatdate:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code> | ||
+ | | | ||
+ | <code><nowiki>{{#dateformat:25 dec 2009|ymd}}</nowiki></code> <br/> | ||
+ | → {{#dateformat:25 dec 2009|ymd}} <!--T:207--> | ||
+ | (your pref), 2009 Dec 25 (default) <br/> | ||
+ | <code><nowiki>{{#formatdate:dec 25,2009|dmy}}</nowiki></code> <br/> | ||
+ | → {{#formatdate:dec 25,2009|dmy}} <!--T:208--> | ||
+ | (your pref), 25 Dec 2009 (default) <br/> | ||
+ | <code><nowiki>{{#dateformat:2009-12-25|mdy}}</nowiki></code> <br/> | ||
+ | → {{#dateformat:2009-12-25|mdy}} <!--T:209--> | ||
+ | (your pref), December 25, 2009 (default) <br/> | ||
+ | <code><nowiki>{{#formatdate:2009 dec 25|ISO 8601}}</nowiki></code> <br/> | ||
+ | → {{#formatdate:2009 dec 25|ISO 8601}} <!--T:210--> | ||
+ | (your pref), 2009-12-25 (default) <br/> | ||
+ | <code><nowiki>{{#dateformat:25 decEmber|mdy}}</nowiki></code> <br/> | ||
+ | → {{#dateformat:25 decEmber|mdy}} <!--T:211--> | ||
+ | (your pref), DecEmber 25 (default) <br/> | ||
+ | <!--T:212--> | ||
+ | ''Note:'' In the example hereinbefore, "your pref" refers to your date preference on the current MediaWiki wiki only. | ||
+ | |||
+ | |||
+ | | <!--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. <br/> | ||
+ | |||
+ | <small>{{TNT|warning}}<!--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).</small> | ||
+ | |||
+ | | {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=48249}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{lc:</nowiki>''string''<nowiki>}}</nowiki></code> | |
− | + | | <code><nowiki>{{lc:DATA CENTER}}</nowiki></code> → {{lc:DATA CENTER}} | |
+ | | {{Anchor|lc|Lc|LC}}<!--T:215--> | ||
+ | The lowercase input. | ||
+ | | {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{lcfirst:</nowiki>''string''<nowiki>}}</nowiki></code> | |
− | + | | <code><nowiki>{{lcfirst:DATA center}}</nowiki></code> → {{lcfirst:DATA center}} | |
+ | | {{Anchor|lcfirst|Lcfirst|LCFIRST}}<!--T:216--> | ||
+ | The input with the <u>very first</u> character lowercase. | ||
+ | | {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{uc:</nowiki>''string''<nowiki>}}</nowiki></code> | |
− | + | | <code><nowiki>{{uc:text transform}}</nowiki></code> → {{uc:text transform}} | |
+ | | {{Anchor|uc|Uc|UC}}<!--T:217--> | ||
+ | The uppercase input. | ||
+ | | {{ {{TNTN|MW version}} |version=1.5|compact=y|comment=and after}} | ||
|- | |- | ||
− | + | | <code><nowiki>{{ucfirst:</nowiki>''string''<nowiki>}}</nowiki></code> | |
− | + | | <code><nowiki>{{ucfirst:text TRANSFORM}}</nowiki></code> → {{ucfirst:text TRANSFORM}} | |
+ | | {{Anchor|ucfirst|Ucfirst|UCFIRST}}<!--T:218--> | ||
+ | The input with the <u>very first</u> character uppercase. | ||
+ | | {{ {{TNTN|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|5}}</nowiki></code> → {{padleft:xyz|5}} <br /> | ||
+ | <code><nowiki>{{padleft:xyz|5|_}}</nowiki></code> → {{padleft:xyz|5|_}} <br /> | ||
+ | <code><nowiki>{{padleft:xyz|5|abc}}</nowiki></code> → {{padleft:xyz|5|abc}}<br /> | ||
+ | <code><nowiki>{{padleft:xyz|2}}</nowiki></code> → {{padleft:xyz|2}} <br /> | ||
+ | <code><nowiki>{{padleft:|1|xyz}}</nowiki></code> → {{padleft:|1|xyz}} | ||
+ | <!--T:219--> | ||
+ | (first character of the string) <br /> | ||
+ | | <!--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. | ||
+ | |||
+ | <!--T:222--> | ||
+ | '''{{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. | ||
+ | | {{ {{TNTN|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|5}}</nowiki></code> → {{padright:xyz|5}} <br /> | ||
+ | <code><nowiki>{{padright:xyz|5|_}}</nowiki></code> → {{padright:xyz|5|_}} <br /> | ||
+ | <code><nowiki>{{padright:xyz|5|abc}}</nowiki></code> → {{padright:xyz|5|abc}} <br /> | ||
+ | <code><nowiki>{{padright:xyz|2}}</nowiki></code> → {{padright:xyz|2}} <br /> | ||
+ | <code><nowiki>{{padright:|1|xyz}}</nowiki></code> → {{padright:|1|xyz}} <br /> | ||
+ | | <!--T:223--> | ||
+ | Identical to <code>padleft</code>, but adds padding characters to the right side. | ||
+ | | {{ {{TNTN|MW version}} |version=1.8|compact=y|comment=and after}} | ||
|} | |} | ||
+ | <!--T:224--> | ||
+ | '''See also:''' <tvar|ext-stringfunctions>{{ll|Extension:StringFunctions}}</>. | ||
− | |||
− | |||
− | |||
− | + | {{anchor|Localization|Localisation}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[ | + | === Localization === <!--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 [[<tvar|date>#Date and time</>|#Date and time]], [[<tvar|formatting>#Formatting</>|#Formatting]], [[<tvar|misc>#Miscellaneous</>|#Miscellaneous]]. More magic words are added by the <tvar|ext-translate>{{ll|Extension:Translate}}</>. | ||
+ | |||
+ | <!--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]]. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! width="10%" | <!--T:228--> | ||
+ | Usage | ||
+ | ! width="40%" | <!--T:229--> | ||
+ | Input → Output | ||
+ | ! <!--T:230--> | ||
+ | Description | ||
+ | ! width="10%" | <!--T:231--> | ||
+ | Version | ||
+ | |- | ||
+ | | {{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 /> <!--T:232--> | ||
+ | (For [[w:Russian language|Russian]])<br /><code><nowiki>{{PLURAL:5|1=Категория|Категории}} </nowiki></code> → Категории | ||
+ | <br /><code><nowiki>{{PLURAL:3|страница|страницы|страниц}}</nowiki></code> → страницы<br /><code><nowiki>{{PLURAL:5|страница|страницы|страниц}}</nowiki></code> → страниц | ||
+ | | <!--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 [[<tvar|meta-help-magicwords>m:Special:MyLanguage/Help:Magic_words#Language-dependent_word_conversions</>|language-dependent]]. <br />Some language codes (ab, av, ba, bxr, ce, crh_cyrl, cv, inh, koi, krc, kv, lbe, lez, mhr, mrj, myv, ru, tt_cyrl, tyv, udm, xal) used 3 plural forms ([[betawiki:Thread:Portal talk:Ru/Plural changes in many languages|updated 01.2014]]): | ||
+ | *Form 1: 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … | ||
+ | *Form 2: 0, 5, 6, 7,8,...18, 19, 100, 1000, 10000, 100000, 1000000, … | ||
+ | *Form 3: 2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 102, 1002, … | ||
+ | | | ||
+ | |- | ||
+ | | {{Anchor|grammar|Grammar|GRAMMAR}}<code><nowiki>{{grammar:N|</nowiki>''noun''<nowiki>}}</nowiki></code> | ||
+ | | | ||
+ | | <!--T:234--> | ||
+ | Outputs the correct inflected form of the given word described by the inflection code after the colon ([[<tvar|meta-help-magicwords>m:Special:MyLanguage/Help:Magic_words#Language-dependent_word_conversions</>|language-dependent]]). Grammar transformations are used for inflected languages like Polish. See also <tvar|manual-wg-grammarform>{{mediawiki|Special:MyLanguage/Manual:$wgGrammarForms|$wgGrammarForms}}</>. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after}} | ||
+ | |- | ||
+ | | {{Anchor|gender|Gender|GENDER}}<code><nowiki>{{gender:username|text for every gender}}</nowiki></code><br /> | ||
+ | <code><nowiki>{{gender:Username|male text|female text|text for unspecified}}</nowiki></code><br /> | ||
+ | <code><nowiki>{{gender:|male text|female text|text for unspecified}}</nowiki></code><br /> | ||
+ | <code><nowiki>{{gender:.|male text|female text|text for unspecified}}</nowiki></code><br /> | ||
+ | | ''<!--T:235--> | ||
+ | (Depends on the named user's gender)'' | ||
+ | | <!--T:236--> | ||
+ | A switch for the gender set in [[Special:Preferences]]. <br/> | ||
+ | ''Note:'' The first example is basically a no-op<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.<br>A blank username field (<tvar|gender><nowiki>{{gender:|</nowiki></>) means the current user.<br> | ||
+ | A dot username (.) means the default user gender on this wiki. | ||
+ | | {{ {{TNTN|MW version}} |version=1.15|compact=y|comment=and after|r=46247}} | ||
+ | |- | ||
+ | | {{Anchor|int|INT}}<code><nowiki>{{int:</nowiki><!--T:285--> | ||
+ | ''message name''<nowiki>}}</nowiki> | ||
+ | | <code><nowiki>{{int:</nowiki>edit<nowiki>}}</nowiki></code> → '''{{int:edit}}''' <br /><small>''<!--T:237--> | ||
+ | (Depends on user language; try: [{{fullurl:{{FULLPAGENAME}}|uselang=fr}}#Localisation fr] • [{{fullurl:{{FULLPAGENAME}}|uselang=ja}}#Localisation ja])''</small> | ||
+ | | <!--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 the [[<tvar|sec>#Transclusion modifiers</>|Transclusion modifiers]] section. | ||
+ | ''Note that this can damage / confuse cache consistency in MediaWiki 1.17 and earlier, see [[bugzilla:14404|bug 14404]].'' | ||
+ | | | ||
+ | |- | ||
+ | | <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki> | ||
+ | | <code><nowiki>{{int:editsectionhint|MediaWiki}}</nowiki></code> → '''{{int:editsectionhint|MediaWiki}}''' | ||
+ | | <!--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. | ||
+ | | | ||
+ | |} | ||
+ | |||
+ | {{anchor|Transclusion modifiers}} | ||
+ | |||
+ | === Transclusion modifiers === <!--T:308--> | ||
+ | |||
+ | <!--T:309--> | ||
+ | <nowiki>{{</nowiki>''Page name''|''optional params''}} usually transcludes another page, by default from the Template:namespace. | ||
+ | |||
+ | <!--T:310--> | ||
+ | These magic words modify that behavior. | ||
+ | |||
+ | |||
+ | {| class="wikitable plainlinks" | ||
+ | ! width="15%" | <!--T:311--> | ||
+ | Usage | ||
+ | ! width="15%" | <!--T:312--> | ||
+ | Output | ||
+ | ! <!--T:313--> | ||
+ | Description | ||
+ | ! width="10%" | <!--T:314--> | ||
+ | Version | ||
+ | |- | ||
+ | | <nowiki>{{:xyz}}</nowiki> | ||
+ | | | ||
+ | | <!--T:315--> | ||
+ | A bare colon is not a template modifier, it's the prefix for the main namespace. <!--T:316--> | ||
+ | Since transclusion defaults to the Template namespace, you would use for example, <tvar|code1>{{:UTC}}</> (vs. <tvar|code2>{{UTC}}</>) to include the text of the main namespace article UTC rather than Template:UTC. | ||
+ | | | ||
+ | |- | ||
+ | | <nowiki>{{int:xyz}}</nowiki> | ||
+ | | | ||
+ | | <!--T:317--> | ||
+ | Same as <tvar|mw><nowiki>{{MediaWiki:xyz}}</nowiki></>, except standard message translation is applied depending on subpages and content/user/uselang language. <!--T:318--> | ||
+ | Another difference is: this doesn't appear under "<tvar|translatesused>{{int|templatesused}}</>". <!--T:319--> | ||
+ | Rendered as <tvar|int>{{int:xyz}}</> if <tvar|mw>[[MediaWiki:xyz]]</> doesn't exist. <!--T:320--> | ||
+ | See also <tvar|1>{{ll|Help:System message}}</>. | ||
+ | | | ||
+ | |- | ||
+ | | <nowiki>{{msg:xyz}}</nowiki> | ||
+ | | | ||
+ | | <!--T:321--> | ||
+ | Even if there is a magic word named "xyz", use template:xyz unless the template doesn't exist (equivalent to <tvar|code><nowiki>{{template:xyz}}</nowiki></>). <!--T:322--> | ||
+ | Normally, magic words have priority when there is a conflict. | ||
+ | | | ||
+ | |- | ||
+ | | <nowiki>{{msgnw:xyz}}</nowiki> | ||
+ | | | ||
+ | | <!--T:323--> | ||
+ | The unexpanded wikitext is rendered (more or less, for details see <tvar|msgnw>{{ll|Help:Template#msgnw|msgnw}}</>). | ||
+ | | | ||
+ | |- | ||
+ | | <nowiki>{{raw:xyz}}</nowiki> | ||
+ | | | ||
+ | | <!--T:324--> | ||
+ | Equivalent to <tvar|msg><code><nowiki>{{msg:xyz}}</nowiki></code></> above. | ||
+ | | {{TNT|MW version|version=1.6|compact=y|comment=and after|r=12925}} | ||
+ | |- | ||
+ | | <nowiki>{{subst:xyz}}</nowiki> | ||
+ | | | ||
+ | | <!--T:325--> | ||
+ | In the wikitext, the tag is substituted by the ''content'' (single-level evaluation only), see [[<tvar|usage>Special:MyLanguage/Help:template#Usage</>|Template usage]]. | ||
+ | | | ||
+ | |} | ||
+ | |||
+ | {{anchor|Miscellaneous}} | ||
+ | |||
+ | === Miscellaneous === <!--T:240--> | ||
+ | |||
+ | |||
+ | {| class="wikitable plainlinks" | ||
+ | ! width="15%" | <!--T:241--> | ||
+ | Usage | ||
+ | ! width="15%" | <!--T:242--> | ||
+ | Output | ||
+ | ! <!--T:243--> | ||
+ | Description | ||
+ | ! width="10%" | <!--T:244--> | ||
+ | Version | ||
+ | |- | ||
+ | | <!--T:286--> | ||
+ | <tvar|code1><code><nowiki>{{#language:</nowiki></>''language code''<tvar|code2><nowiki>}}</nowiki></code><br /><code><nowiki>{{#language:ar}}</nowiki></code> <br /><code><nowiki>{{#language:</nowiki></>''language code''<tvar|code3><nowiki>|</nowiki><br /></>''target language code''<tvar|code5><nowiki>}}</nowiki></code> <br /><code><nowiki>{{#language:ar|en}}</nowiki></code></> | ||
+ | | {{#language:language code}} <br />{{#language:ar}} <br />{{#language:language code|<!--T:287--> | ||
+ | target language code<tvar|code1>}} <br /></>Arabic | ||
+ | | <!--T:245--> | ||
+ | The full name of the language for the given [[<tvar|manual-langcode>Special:MyLanguage/Manual:Language#lang-code</>|language code]]: native name (language autonym) by default, name translated in target language if a target language code is specified. <tvar|ext-cldr>{{ll|Extension:CLDR}}</> must be installed for the translation to work. | ||
+ | | {{ {{TNTN|MW version}} |version=1.7|compact=y|comment=and after|r=14490}}<br /> {{ {{TNTN|MW version}} |version=1.18|compact=y|comment=and after|r=91875}} <!--T:246--> | ||
+ | (translation) | ||
+ | |- | ||
+ | | <code><nowiki>{{#special:</nowiki><!--T:288--> | ||
+ | ''special page name''<nowiki>}}</nowiki> <br /><nowiki>{{#special:userlogin}}</nowiki></code> | ||
+ | | {{#special:special page name}} <br />{{#special:userlogin}} | ||
+ | | <!--T:247--> | ||
+ | The localized name for the given canonical Special: page. | ||
+ | | {{ {{TNTN|MW version}} |version=1.9|compact=y|comment=and after|r=17321}} | ||
+ | |- | ||
+ | | <code><nowiki>{{#speciale:</nowiki><!--T:289--> | ||
+ | ''special page name''<nowiki>}}</nowiki> <br /><nowiki>{{#speciale:userlogin}}</nowiki></code> | ||
+ | | {{#speciale:special page name}} <br />{{#speciale:userlogin}} | ||
+ | | <!--T:248--> | ||
+ | The localized and URL-encoded name for the given canonical Special: page. | ||
+ | | {{ {{TNTN|MW version}} |version=1.20|compact=y|comment=and after|gerrit change=4340}} | ||
+ | |- | ||
+ | | <code><nowiki>{{#tag:</nowiki><!--T:290--> | ||
+ | ''tagname'' <tvar|code1><br/><nowiki>|</nowiki></>''content'' <tvar|code2><br/><nowiki>|</nowiki></>''attribute1=value1'' <tvar|code3><br /><nowiki>|</nowiki></>''attribute2=value2''<br /><nowiki>}}</nowiki></code> | ||
+ | | <!--T:249--> | ||
+ | ''(Depends on parser tag)'' | ||
+ | | <!--T:250--> | ||
+ | Alias for XML-style MediaWiki parser tags or extension tags. It allows execution of wiki code and <tvar|ext-pf>{{ll|Extension:ParserFunctions}}</> 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--> | ||
+ | <tvar|code1><code><</>tagname ''attribute1''="''value1''"<br />''attribute2''="''value2''"<tvar|code2>></code></>''Your content goes here''<tvar|code3><code><</>/tagname<tvar|code4>></code></> | ||
+ | |||
+ | <!--T:252--> | ||
+ | …can be rewritten like this: | ||
+ | |||
+ | <!--T:253--> | ||
+ | <tvar|code1><code><nowiki>{{#tag:</nowiki></code></>''tagname''<tvar|code2><code><nowiki>|</nowiki></code></>''Your content goes here''<tvar|code3><code><nowiki>|</nowiki></code></>''attribute1''=''value1''<tvar|code4><code><nowiki>|</nowiki></code></>''attribute2''=''value2''<tvar|code5><code><nowiki>}}</nowiki></code></> | ||
+ | |||
+ | <!--T:254--> | ||
+ | Example for the [[<tvar|ext-cite>Special:MyLanguage/Extension:Cite</>|Cite extension]]'s <code><ref></code> tags: | ||
+ | |||
+ | |||
+ | <!--T:255--> | ||
+ | <code><nowiki>{{#tag:ref|Citation text goes here,</nowiki><br /><nowiki>and you can include parser functions</nowiki><br /><nowiki>like {{#expr: ... }} and magic words</nowiki><br /><nowiki>like {{PAGENAME}}.|name="multiple"}}</nowiki></code> | ||
+ | |||
+ | |||
+ | <small>{{TNT|warning}}<!--T:256--> | ||
+ | You must write <tvar|code1><code><nowiki>{{#tag:</nowiki></code></>''tagname''<tvar|code2><code><nowiki>||</nowiki></code></>''attribute1''=''value1''<tvar|code3><code><nowiki>|</nowiki></code></>''attribute2''=''value2''<tvar|code4><code><nowiki>}}</nowiki></code></> to pass an empty content. No space is permitted in the area reserved for content between the pipe characters <tvar|code5><code>{{!}}{{!}}</code></> before ''attribute1''.</small> | ||
+ | | {{ {{TNTN|MW version}} |version=1.12|compact=y|comment=and after|r=29482}} | ||
+ | |} | ||
+ | |||
+ | [[Category:Help pages]] |