https://nordiclarp.org/w/index.php?title=Help:Magic_words&feed=atom&action=historyHelp:Magic words - Revision history2024-03-28T22:29:16ZRevision history for this page on the wikiMediaWiki 1.34.2https://nordiclarp.org/w/index.php?title=Help:Magic_words&diff=21814&oldid=prevJohannes Axner at 17:00, 11 January 20192019-01-11T17:00:09Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 17:00, 11 January 2019</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l427" >Line 427:</td>
<td colspan="2" class="diff-lineno">Line 427:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Wikipedia technical help|collapsed}}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Wikipedia technical help|collapsed}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Category:<del class="diffchange diffchange-inline">Wikipedia </del>features<del class="diffchange diffchange-inline">]]</del></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Category:<ins class="diffchange diffchange-inline">Nordic Larp Wiki </ins>features]]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">[[he:עזרה:משתנים</del>]]</div></td><td colspan="2"> </td></tr>
</table>Johannes Axnerhttps://nordiclarp.org/w/index.php?title=Help:Magic_words&diff=19299&oldid=prevJohannes Axner: 1 revision imported2019-01-09T09:53:24Z<p>1 revision imported</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #222; text-align: center;">Revision as of 09:53, 9 January 2019</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Johannes Axnerhttps://nordiclarp.org/w/index.php?title=Help:Magic_words&diff=19298&oldid=preven>Ahecht: {{pp|vandalism|small=yes}}2019-01-03T18:20:38Z<p>{{pp|vandalism|small=yes}}</p>
<p><b>New page</b></p><div>{{pp|vandalism|small=yes}}<br />
{{redirect|WP:MAGIC|an introduction|Help:Magic words for beginners|help on the automatic transformation of wikitext|Help:Magic|the WikiProject on stage magic and illusions|Wikipedia:WikiProject Magic}}<br />
{{Wikipedia how-to|H:MW|WP:MAGIC}}<br />
<br />
'''Magic words''' (including '''parser functions''', '''variables''' and '''behavior switches''') are features of [[Help:Wiki markup|wiki markup]] that give instructions to Wikipedia's underlying [[MediaWiki]] software. For example, magic words can suppress or position the table of contents, disable indexing by external search engines, and produce output dynamically based on the current page or on user-defined conditional logic. Some of these features are especially useful for [[WP:Templates|templates]].<br />
<br />
This page is a quick reference for magic words. For more information, refer to the main MediaWiki documentation:<br />
* [[mw:Help:Magic words]]: All standard magic words, including the "standard" parser functions.<br />
* [[mw:Help:Extension:ParserFunctions]]: Additional parser functions, including conditional expressions.<br />
<br />
==General information==<br />
<br />
In general, there are three types of magic words<br />
# '''[[#Behavior switches|Behavior switches]]''': often appear in double underscores, all uppercase, e.g., <code>__NOTOC<nowiki />__</code>. They will change the behavior of a page, rather than return a value.<br />
# '''[[#Parser functions|Parser functions]]''': all in lowercase. A parser function will be followed by colon and pipe-separated parameters, e.g., <code><nowiki>{{#ifexpr:Y|Yes|No}}</nowiki></code>, wrapped in double braces. They will take a value and return a value.<br />
# '''[[#Variables|Variables]]''': these are all uppercase, e.g., {{tld|PAGENAME}}. A variable will be wrapped in double braces and will return a value in its place.<br />
<br />
The software generally interprets magic words in the following way.<br />
* Magic words are [[case sensitive]].<br />
* [[Whitespace character|White space]] is generously allowed for readability. It will be stripped from the start and end of their keywords and parameters (as is also done inside templates).<br />
* They can be [[WP:Transclusion|transcluded]], even variables "about the current page". This is ensured by the parsing order.<br />
* Instead of magically transforming into HTML instructions, {{tag|[[help:wikitext#Nowiki|nowiki]]|o}} tags remove this magic so a magic word can itself be displayed (documented).<br />
<br />
{{Magic<nowiki />}} words compared to {{[[Help:Template|template]]<nowiki />}}:<br />
* As with templates, magic words can be [[help:transclusion|transcluded]] and [[Help:substitution|substituted]].<br />
* The names of {{magic words<nowiki />}} are purposely chosen to be unlike the names of {{templates<nowiki />}}, and vice versa. Many parser function names will begin with the # sign, but template names [[wp:NCHASHTAG | will not start with a # sign]], and probably not end in a : colon character, or be all-uppercase.<br />
* The first parameter's syntax differs. In {{#magic: p1<nowiki />| p2 | p3}}, the name is #magic and it will be followed by an unspaced : colon and a required input parameter, p1. The first {{para|p1}} of a template is optional but would be preceded by a | pipe instead of a : colon.<br />
<br />
==Behavior switches==<br />
{{anchor|Behaviour switches}}<br />
{{further|mw:Help:Magic words#Behavior switches}}<br />
<br />
{| class="wikitable plainrowheaders"<br />
! scope="col" | Switch<br />
! scope="col" | Description<br />
|-<br />
! scope="row" | <kbd><nowiki>__TOC__</nowiki></kbd><br />
| Places the page's [[Help:Table of contents|table of contents (TOC)]] at the word's position.<br />
|-<br />
! scope="row" | <kbd><nowiki>__FORCETOC__</nowiki></kbd><br />
| Forces the TOC to appear in its default position. Can be used anywhere on a page.<br />
|-<br />
! scope="row" | <kbd><nowiki>__NOTOC__</nowiki></kbd><br />
| Suppresses the appearance of the page's TOC. Can be used anywhere on a page.<br />
|-<br />
! scope="row" | <kbd><nowiki>__NOEDITSECTION__</nowiki></kbd><br />
| Hides the "edit" links normally beside ''all'' headings on the page. To hide the edit link beside a ''particular'' heading, specify the heading using e.g. an [[HTML element|HTML tag]] such as {{tag|h2|content=''heading''}} rather than with the usual wiki equals-signs syntax (e.g. {{nowrap|1=<kbd>== ''heading'' ==</kbd>}}{{thinsp}}).<br />
|-<br />
! scope="row" | <kbd><nowiki>__NEWSECTIONLINK__</nowiki></kbd><br />
| On non-talk pages, adds a "{{int:vector-action-addsection}}" link as a means to add a new section to the page.<br />
|-<br />
! scope="row" | <kbd><nowiki>__NONEWSECTIONLINK__</nowiki></kbd><br />
| Removes the "{{int:vector-action-addsection}}" link (the add-new-section link) on talk pages.<br />
|-<br />
! scope="row" | <kbd><nowiki>__NOGALLERY__</nowiki></kbd><br />
| Replaces thumbnails on a category page with normal links.<br />
|-<br />
! scope="row" | <kbd><nowiki>__HIDDENCAT__</nowiki></kbd><br />
| Makes a category [[WP:HIDDENCAT|hidden]] when included on that category's page.<br />
|-<br />
! scope="row" | <kbd><nowiki>__INDEX__</nowiki></kbd><br />
| Instructs [[Web search engine|search engine]]s to index the page.<br />
|-<br />
! scope="row" | <kbd><nowiki>__NOINDEX__</nowiki></kbd><br />
| Instructs search engines not to index the page. See [[Wikipedia:Controlling search engine indexing]].<br />
|-<br />
! scope="row" | <kbd><nowiki>__STATICREDIRECT__</nowiki></kbd><br />
| Prevents the link on a [[Help:Redirect|redirection]] page from being updated automatically when the page to which it redirects is moved (and "Update any redirects that point to the original title" is selected). Also instructs [[Help:Interwiki linking|interwiki]] [[Wikipedia:Bots|bots]] to treat the page as if an article.<br />
|-<br />
! scope="row" | <kbd><nowiki>__DISAMBIG__</nowiki></kbd><br />
| Marks a page as a [[WP:DAB|disambiguation page]], adds it to [[Special:DisambiguationPages]] and places inward links in [[Special:DisambiguationPageLinks]]. (See [[mw:Extension:Disambiguator]].)<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{DISPLAYTITLE:''title''}}</kbd><br />
| Used to amend the [[WP:DISPLAYTITLE|displayed form]] of the page's title.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{DEFAULTSORT:''sortkey''}}</kbd><br />
| Sets the default [[WP:SORTKEY|key]] (the index) under which the page is categorised.<br />
|-<br />
! scope="row" | <kbd>[[mw:Extension:Wikibase Client#noexternallanglinks|{<nowiki/>{NOEXTERNALLANGLINKS}}]]</kbd><br />
|| (equivalent to {<nowiki/>{NOEXTERNALLANGLINKS|*}}{{thinsp}}) Suppresses the automated inclusion of [[Wikidata:Help:Linking Wikipedia pages|Wikidata]] [[Help:Interlanguage links|interlanguage links]] on the lefthand side of the page. Links to particular rather than all languages may be suppressed by using {<nowiki/>{NOEXTERNALLANGLINKS|''list''}}, where ''list'' a [[Vertical bar|pipe]]-[[Delimiter|delimited]] list of [[language code]]s (e.g. {<nowiki/>{NOEXTERNALLANGLINKS|fr{{pipe}}es{{pipe}}ja}} to suppress the French ("fr"), Spanish ("es") and Japanese ("ja") interlanguage links).<br />
|}<br />
<br />
==Variables==<br />
{{Shortcut|WP:VAR}}<br />
{{further|mw:Help:Magic words#Variables|Wikipedia:Page name#sub}}<br />
<br />
{| class="wikitable plainrowheaders"<br />
! scope="col" | Page name variable<br />
! scope="col" | Output<br />
! scope="col" | Description<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{FULLPAGENAME}}</kbd><br />
| {{FULLPAGENAME}}<br />
| Canonical [[Help:page name|page name]]. ''Title line''. Title unless letter-case is altered with {{tld|DISPLAYTITLE}}.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{PAGENAME}}</kbd><br />
| {{PAGENAME}}<br />
| Title line excluding [[Wikipedia:Namespace|namespace]].<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{BASEPAGENAME}}</kbd><br />
| {{BASEPAGENAME}}<br />
| Title of parent page, excluding namespace.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{ROOTPAGENAME}}</kbd><br />
| {{ROOTPAGENAME}}<br />
| Title of topmost parent (before all subpages), excluding namespace.<br />
|-<br />
! scope="row" | <kbd>[[wp:pagename#sub|{<nowiki/>{SUBPAGENAME}}]]</kbd><br />
| {{SUBPAGENAME}}<br />
| On a subpage, rightmost portion of ''current'' title; higher subpagenames show as [[breadcrumb (navigation)|backlinks]].<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{ARTICLEPAGENAME}}</kbd><br />
| {{ARTICLEPAGENAME}}<br />
| rowspan="2" | Title of the subject page associated with the current page. These are useful on talk pages (but see note about Category talk pages).<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{SUBJECTPAGENAME}}</kbd><br />
| {{SUBJECTPAGENAME}}<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{TALKPAGENAME}}</kbd><br />
| {{TALKPAGENAME}}<br />
| Title of the talk page associated with the current page. Useful on subject pages.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{NAMESPACENUMBER}}</kbd><br />
| {{NAMESPACENUMBER:{{FULLPAGENAME}}}}<br />
| Number of the current page's namespace.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{NAMESPACE}}</kbd><br />
| {{NAMESPACE}}<br />
| Namespace of the title.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{ARTICLESPACE}}</kbd><br />
| {{ARTICLESPACE}}<br />
| rowspan="2" | On a talk page, the namespace part of the title of the associated subject page.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{SUBJECTSPACE}}</kbd><br />
| {{SUBJECTSPACE}}<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{TALKSPACE}}</kbd><br />
| {{TALKSPACE}}<br />
| Namespace of the talk page associated with the current page.<br />
|-<br />
! scope="row" | {{longitem|style=line-height:1.5em|<kbd>{<nowiki/>{FULLPAGENAMEE}<nowiki/>}</kbd>,<br/><kbd>{<nowiki/>{PAGENAMEE}<nowiki/>}</kbd>,<br/>{{pad|0.4em}}(etc.)}}<br />
| {{longitem|style=line-height:1.5em|{{FULLPAGENAMEE}},<br/>{{PAGENAMEE}},<br/>(etc.)}}<br />
| Adding an E to the end of the above variables, renders the above encoded for use in MediaWiki [[URL]]s (i.e. with underscores replacing spaces).<br />
|}<!--<br />
<br />
-->''Note:'' The magic words above can also take a parameter, in order to parse values on a page other than the current page. A colon ({{thinsp}}''':'''{{thinsp}}) is used to pass the parameter, rather than a pipe ({{thinsp}}'''&#124;'''{{thinsp}}) that is used in templates, like <kbd><nowiki>{{MAGICWORD:value}}</nowiki></kbd>. For example, <kbd><nowiki>{{TALKPAGENAME:Wikipedia:MOS}}</nowiki></kbd> returns <kbd><nowiki>Wikipedia talk:MOS</nowiki></kbd> on any page. See [[meta:Help:Page name]] for more details of parser functions.<br />
<br />
''Note:''<br />
In the "Category" and "Category talk" namespaces, to wikilink (some) page name variables may require [[help:link|prefixing a colon]] to avoid unwanted categorization.<br />
<br />
{| class="wikitable plainrowheaders"<br />
! scope="col" | Site variable<br />
! scope="col" | Example<br />
! scope="col" | Description<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{SITENAME}}</kbd><br />
| {{SITENAME}}<br />
|<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{SERVER}}</kbd><br />
| {{SERVER}}<br />
|<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{SERVERNAME}}</kbd><br />
| {{SERVERNAME}}<br />
|<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{SCRIPTPATH}}</kbd><br />
| {{SCRIPTPATH}}<br />
|<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{CURRENTVERSION}}</kbd><br />
| {{CURRENTVERSION}}<br />
| Returns current MediaWiki version.<br />
|}<br />
<br />
===Other variables by type===<br />
{| class="wikitable"<br />
! scope="col" | Date and time<br />
! scope="col" | Revision data<br />
! scope="col" | Statistics{{sup|b}}<br />
|- style="vertical-align:top"<br />
|<br />
{|<br />
| ''Universal time''<br />
{{startplainlist}}<br />
* <kbd>{<nowiki/>{CURRENTYEAR}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTMONTH}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTMONTHNAME}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTMONTHABBREV}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTDAY}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTDAY2}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTDOW}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTDAYNAME}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTTIME}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTHOUR}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTWEEK}}</kbd><br />
* <kbd>{<nowiki/>{CURRENTTIMESTAMP}}</kbd><br />
{{endplainlist}}<br />
| ''Local website time''<br />
{{startplainlist}}<br />
* <kbd>{<nowiki/>{LOCALYEAR}}</kbd><br />
* <kbd>{<nowiki/>{LOCALMONTH}}</kbd><br />
* <kbd>{<nowiki/>{LOCALMONTHNAME}}</kbd><br />
* <kbd>{<nowiki/>{LOCALMONTHABBREV}}</kbd><br />
* <kbd>{<nowiki/>{LOCALDAY}}</kbd><br />
* <kbd>{<nowiki/>{LOCALDAY2}}</kbd><br />
* <kbd>{<nowiki/>{LOCALDOW}}</kbd><br />
* <kbd>{<nowiki/>{LOCALDAYNAME}}</kbd><br />
* <kbd>{<nowiki/>{LOCALTIME}}</kbd><br />
* <kbd>{<nowiki/>{LOCALHOUR}}</kbd><br />
* <kbd>{<nowiki/>{LOCALWEEK}}</kbd><br />
* <kbd>{<nowiki/>{LOCALTIMESTAMP}}</kbd><br />
{{endplainlist}}<br />
|}<br />
|{{startplainlist}}<br />
* <kbd>{<nowiki/>{REVISIONID}}{{sup|a}}</kbd><br />
* <kbd>{<nowiki/>{REVISIONDAY}}</kbd><br />
* <kbd>{<nowiki/>{REVISIONDAY2}}</kbd><br />
* <kbd>{<nowiki/>{REVISIONMONTH}}</kbd><br />
* <kbd>{<nowiki/>{REVISIONYEAR}}</kbd><br />
* <kbd>{<nowiki/>{REVISIONTIMESTAMP}}</kbd><br />
* <kbd>{<nowiki/>{REVISIONUSER}}{{sup|c}}</kbd><br />
{{endplainlist}}<br />
|{{startplainlist}}<br />
* <kbd>{<nowiki/>{NUMBEROFPAGES}}</kbd><br />
* <kbd>{<nowiki/>{NUMBEROFARTICLES}}</kbd><br />
* <kbd>{<nowiki/>{NUMBEROFFILES}}</kbd><br />
* <kbd>{<nowiki/>{NUMBEROFEDITS}}</kbd><br />
<!--disabled in MediaWiki (see talk page): * <kbd>{<nowiki/>{NUMBEROFVIEWS}}</kbd><br />
-->* <kbd>{<nowiki/>{NUMBEROFUSERS}}</kbd><br />
* <kbd>{<nowiki/>{NUMBEROFADMINS}}</kbd><br />
* <kbd>{<nowiki/>{NUMBEROFACTIVEUSERS}}</kbd><br />
{{endplainlist}}<br />
|}<br />
:{{sup|a}} <kbd>{<nowiki/>{REVISIONID}}</kbd> cannot be [[Wikipedia:Substitution|substituted]] and does not function in preview.<br />
:{{sup|b}} English Wikipedia.<br />
:{{sup|c}} This shows the last user to edit the page. There is no way to show the user viewing the page due to technical restrictions.<br />
<br />
==Parser functions==<br />
{{Shortcut|WP:PF|WP:PARSER}}<br />
{{further|mw:Help:Magic words#Parser functions|mw:Help:Extension:ParserFunctions}}<br />
<br />
===Metadata===<br />
{| class="wikitable plainrowheaders"<br />
! scope="col" | Function<br />
! scope="col" | Description<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{PAGEID}}</kbd><br />
| Unique page identifier number.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{PAGESIZE:''fullpagename''}}</kbd><br />
| Size of named page in bytes.<br />
|-<br />
! scope="row" | {{anchor|PROTECTIONLEVEL}}<kbd>{<nowiki/>{PROTECTIONLEVEL:''action''{{pipe}}''fullpagename''}}</kbd><br />
| [[Wikipedia:Protection policy|Protection level]] assigned to ''action'' ("edit", "move", etc.) on named page.<br />
|-<br />
! scope="row" | {{anchor|PROTECTIONEXPIRY}}<kbd>{<nowiki/>{PROTECTIONEXPIRY:''action''{{pipe}}''fullpagename''}}</kbd><br />
| [[Wikipedia:Protection policy|Protection expiry]] assigned to ''action'' ("edit", "move", etc.) on named page.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{PENDINGCHANGELEVEL}}</kbd><br />
| Protection level for [[WP:PC|pending changes]] on the current page.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{PAGESINCATEGORY:''pagename''}}</kbd><br />
| Number of pages in the category named ''pagename''.<br />
|-<br />
! scope="row" | <kbd>{<nowiki/>{NUMBERINGROUP:''groupname''}}</kbd><br />
| Number of users in the [[Wikipedia:User access levels|user group]] named ''groupname''.<br />
|}<br />
To output numbers without comma [[Delimiter|separator]]s (for example, as "123456789" rather than "123,456,789"), append the parameter <kbd>|R</kbd>.<br />
<br />
===Formatting===<br />
{| class="wikitable plainrowheaders"<br />
! scope="col" | Function<br />
! scope="col" | Description<br />
|-<br />
! scope="row" | <kbd> {{((}}lc:''string''{{))}} </kbd><br />
| Converts all characters in ''string'' to lower case.<br />
|-<br />
! scope="row" | <kbd> {{((}}lcfirst:''string''{{))}} </kbd><br />
| Converts first character of ''string'' to lower case.<br />
|-<br />
! scope="row" | <kbd> {{((}}uc:''string''{{))}} </kbd><br />
| Converts all characters in ''string'' to upper case.<br />
|-<br />
! scope="row" | <kbd> {{((}}ucfirst:''string''{{))}} </kbd><br />
| Converts first character of ''string'' to upper case.<br />
|-<br />
! scope="row" | <kbd> {{((}}formatnum:''unformatted_number''{{))}}<br>{{((}}formatnum:''formatted_num'' {{pipe}}R{{))}} </kbd><br />
| Adds comma separators to an ''unformatted_number'' (e.g. 123456789 becomes {{formatnum:123456789}}). To remove such formatting, use <kbd>{{((}}formatnum:''formatted_number''{{pipe}}R{{))}}</kbd> (i.e. <kbd>{{braces|formatnum:7,654,321{{pipe}}R}}</kbd>, for example, produces {{formatnum:7,654,321|R}}).<br />
|-<br />
! scope="row" | <kbd> {{((}}#dateformat:''date''{{pipe}}''format''{{))}}<br/>{{((}}#formatdate:''date''{{pipe}}''format''{{))}} </kbd><br />
| Formats a date according to user preferences; a default can be given as an optional case-sensitive second parameter for users without date preference; can convert a date from an existing format to any of <code>dmy</code>, <code>mdy</code>, <code>ymd</code>, or <code>[[ISO 8601]]</code> formats, with the user's preference overriding the specified format.<br />
|-<br />
! scope="row" | <kbd> {{((}}padleft:''xyz''{{pipe}}''stringlength''{{))}} <br/> {{((}}padright:''xyz''{{pipe}}''stringlength''{{))}} <br><br> {{((}}padleft:''xyz''{{pipe}}''length''{{pipe}}''padstr''{{))}} <br/>{{((}}padright:''xyz''{{pipe}}''length''{{pipe}}''padstr''{{))}} </kbd><br />
| Pad with zeroes '0' to the right or left, to fill the given length; an alternative padding string can be given as a third parameter; the repeated padding string (''padstr'') will be truncated if its length does not evenly divide the required number of characters.<br />
|-<br />
! scope="row" | <kbd> {{((}}plural:''N''{{pipe}}''singular''{{pipe}}''plural''{{))}} </kbd><br />
| Outputs ''singular'' if ''N'' is equal to 1, otherwise outputs ''plural''. See the [[mw:Help:Magic words#Localization|documentation at mediawiki.org]] for more details.<br />
|-<br />
! scope="row" | <kbd> {{((}}#time:''format''{{pipe}}''object''{{))}} </kbd><br/> <kbd> {{((}}#timel:''format''{{pipe}}''object''{{))}} <br><br> {{((}}#time:d F Y{{pipe}}''date''{{pipe}}''langcode''{{))}} </kbd><br />
| Used to format dates and times, for ISO format, dots or English month names. <kbd>#timel</kbd> is based on local time as defined for each wiki; for English Wikipedia, this is identical to <kbd>#time</kbd>.<br />The optional 3rd parameter is the output language code (French, German, Swedish: fr, de, sv, etc.). Example Finnish: <kbd><nowiki>{{#time:d F Y|June 30, 2016|fi}}</nowiki></kbd> shows: {{#time:d F Y|June 30, 2016|fi}} (June). ISO to German: <kbd><nowiki>{{#time:d. M Y|1987-10-31|de}}</nowiki></kbd> shows: {{#time:d. M Y|1987-10-31|de}}.<br />For format codes, see: [[mw:Help:Extension:ParserFunctions##time]]. Use the format <kbd><nowiki>{{#time: H:i, j F Y (e)|...}}</nowiki></kbd> to match the format used by timestamps in signatures.<br />
|-<br />
! scope="row" | <kbd> {{((}}gender:''user''{{pipe}}''m_out''{{pipe}}''f_out''{{pipe}}''u_out''{{))}} </kbd><br />
| Outputs ''m_out'', ''f_out'' or ''u_out'' according to whether the gender specified in ''user''{{thinsp}}'s preferences is, respectively, male, female or unspecified. Other parameter permutations are available, see [[mw:Help:Magic words#gender]] and [[translatewiki:Special:MyLanguage/Gender|translatewiki:Gender]].<br />
|-<br />
! scope="row" | <kbd> [[mw:Help:Magic_words#Miscellaneous|{{((}}#tag:''tag''{{pipe}}''content with magic''{{))}} ]]</kbd><br />
| Only way to [[eval]]uate magic words ''inside a tag'', in order to generate <code>&lt;''tag''>''magic''&lt;/''tag''></code>. Also handles tag attributes.<br />
|}<br />
<br />
===Paths===<br />
{| class="wikitable plainrowheaders"<br />
! scope="col" | Function<br />
! scope="col" | Description<br />
|-<br />
! scope="row" | <kbd> {{((}}localurl:''fullpagename'' {{pipe}}''query''{{))}} </kbd><br />
| Relative [[Path (computing)|path]] to page name. The ''query'' parameter is optional.<br />
|-<br />
! scope="row" | <kbd> {{((}}fullurl:''fullpagename'' {{pipe}}''query''{{))}} </kbd><br />
| Absolute path, without [[Application layer|protocol prefix]] (i.e. without "{{thinsp}}<nowiki>http:</nowiki>{{thinsp}}" etc.), to page name. The ''query'' parameter is optional.<br />
|-<br />
! scope="row" | <kbd> {{((}}canonicalurl:''fullpagename'' {{pipe}}''query''{{))}} </kbd><br />
| Absolute path, including protocol prefix, to page name. The ''query'' parameter is optional.<br />
|-<br />
! scope="row" | <kbd> {{((}}filepath:''filename''{{))}} </kbd><br />
| Absolute path to the media file ''filename''.<br />
|-<br />
! scope="row" | <kbd> {{((}}urlencode:''string''{{))}} </kbd><br />
| Encodes ''string'' for use in URL query strings; <kbd>{{braces|urlencode:test string}}</kbd>, for example, produces: {{urlencode:test string}}. To encode ''string'' for use in URL paths or MediaWiki page names, append, respectively, {{para||PATH}} or {{para||WIKI}} (to produce "{{urlencode:test string|PATH}}" or "{{urlencode:test string|WIKI}}").<br />
|-<br />
! scope="row" | <kbd> {{((}}anchorencode:''string''{{))}} </kbd><br />
| Input encoded for use in MediaWiki URL [[Help:Anchor|section anchor]]s.<br />
|-<br />
! scope="row" | <kbd> {{((}}ns:''n''{{))}} </kbd><br />
| Returns the name of the [[Help:Namespace|namespace]] whose index is the number ''n''. For MediaWiki URLs, use <kbd>{{((}}nse:{{))}}</kbd>.<br />
|-<br />
! scope="row" | <kbd>[[mw:Help:Extension:ParserFunctions##rel2abs|{{((}}#rel2abs:''path''{{))}}]] </kbd><br />
| Converts a relative file path to an absolute path.<br />
|-<br />
! scope="row" | <kbd> [[mw:Help:Extension:ParserFunctions##titleparts|{{((}}#titleparts:''fullpagename''{{pipe}}''number''{{pipe}}''first segment''{{))}}]]</kbd><br />
| Splits the fullpagename (title) into that number of segments.<br />
|}<br />
<br />
===Conditional===<br />
{{further|Help:Conditional expressions}}<br />
<br />
{| class="wikitable plainrowheaders"<br />
! scope="col" | Function<br />
! scope="col" | Description<br />
|-<br />
! scope="row" |<kbd> [[mw:Help:Extension:Parser functions##expr|{{((}}#expr:''expression''{{))}}]] </kbd><br />
| Evaluates ''expression'' (see [[m:Help:Calculation]]).<br />
|-<br />
! scope="row" | <kbd> [[mw:Help:Extension:Parser functions##if|{{((}}#if:''string'' {{pipe}}''result1'' {{pipe}}''result2''{{))}}]] </kbd><br />
| Outputs ''result2'' if ''string'' is [[Empty string|empty]], otherwise outputs ''result1''.<br />
|-<br />
! scope="row" | <kbd> [[mw:Help:Extension:Parser functions##ifeq|{{((}}#ifeq:''string1''{{pipe}}''string2'' {{pipe}}''result1'' {{pipe}}''result2''{{))}}]] </kbd><br />
| Outputs ''result1'' if ''string1'' and ''string2'' are equal (alphabetically or numerically), otherwise outputs ''result2''.<br />
|-<br />
! scope="row" | <kbd> [[mw:Help:Extension:Parser functions##iferror|{{((}}#iferror:''test_string'' {{pipe}}''result1'' {{pipe}}''result2''{{))}}]] </kbd><br />
| Outputs ''result1'' if ''test_string'' generates a parsing error, otherwise outputs ''result2''.<br />
|-<br />
! scope="row" | <kbd> [[mw:Help:Extension:Parser functions##ifexpr|{{((}}#ifexpr:''expression'' {{pipe}}''result1'' {{pipe}}''result2''{{))}}]] </kbd><br />
| Outputs ''result1'' if ''expression''{{thinsp}} is true, otherwise outputs ''result2''.<br />
|-<br />
! scope="row" | <kbd> [[mw:Help:Extension:Parser functions##ifexist|{{((}}#ifexist:''pagetitle'' {{pipe}}''result1'' {{pipe}}''result2''{{))}}]] </kbd><br />
| Outputs ''result1'' if the page [<nowiki/>[''pagetitle'']] exists, otherwise outputs ''result2''. Note that underscores are needed for spaces in namespaces.<br />
|-<br />
! scope="row" style="white-space: nowrap;" | <kbd> [[mw:Help:Extension:Parser functions##switch|{{((}}#switch:''string'' {{pipe}}''c1''=''r1'' {{pipe}}''c2''=''r2'' ... {{pipe}}''default''{{))}}]] </kbd><br />
| Outputs ''r1'' if ''string'' is ''c1'', ''r2'' if ''string'' is ''c2'', etc., otherwise outputs ''default'' (if provided).<br />
|}<br />
<br />
If, in these conditional functions, [[Empty string|empty]] unnamed parameters are to be parsed as empty rather than as text (i.e. as empty rather than as the text "{{{1}}}", "{{{2}}}", etc.), they will require trailing pipes (i.e. <kbd>{{(((}}1{{pipe}}{{)))}}</kbd>, <kbd>{{(((}}2{{pipe}}{{)))}}</kbd>, etc., rather than <kbd>{{(((}}1{{)))}}</kbd>, <kbd>{{(((}}2{{)))}}</kbd>, etc.).<br />
* For the use of these functions in tables, see [[Wikipedia:Conditional tables]].<br />
<br />
===Other===<br />
{| class="wikitable plainrowheaders"<br />
! scope="col" | Function<br />
! scope="col" | Description<br />
|-<br />
! scope="row" | <kbd>[[mw:Extension:Babel#Usage|{<nowiki/>{#babel:''code1''|''code2''|...}}]]</kbd><br />
| Render [[wp:userbox|userbox]]es telling your language skills. Improves upon {{tl|Babel}} (an alternative).<br />
|-<br />
! scope="row" | <kbd>[[mw:Extension:CategoryTree|{<nowiki/>{#categorytree:''category''|...}}]]</kbd><br />
| List pages in a category, recursively.<br />
|-<br />
! scope="row" | <kbd>[[mw:Extension:GeoData#Parser function|{<nowiki/>{#coordinates:''arg1''|''arg2''|...}}]]</kbd><br />
| Save the [[Geographic coordinate system|GeoData coordinates]] of the subject to the page's database. Used in {{tl|coord}}.<br />
|-<br />
! scope="row" style=white-space:nowrap| <kbd> [[mw:Extension:Scribunto#Usage|{<nowiki />{#invoke:''module''|''function''|''arg1''|...}}]]</kbd><br />
|| Use [[mw:extension:scribunto|Scribunto]] to transclude a [[wp:lua|lua]] template, e.g. function ''replace'' in [[Module:String#replace|module ''String'']].<br />
|-<br />
! scope="row" | <kbd>{<nowiki />{[[mw:Help:Magic_words#Miscellaneous|#language]]:[[ISO_639|''code1'']]|''code2''}}</kbd><br />
| Print the name represented by the language code, e.g. '''en''' → '''English'''. Print in language 2 if given.<br />
|-<br />
! scope="row" | <kbd>[[mw:Extension:Labeled Section Transclusion|<nowiki>{{#lst:}} {{#lsth:}} {{#lstx:}}</nowiki>]]</kbd><br />
| Three ways to [[Help:Labeled section transclusion|transclude a section of a page]].<br />
|-<br />
! scope="row" | <kbd>[[m:Wikidata/Notes/Inclusion syntax v0.4|{<nowiki />{#property:''arg1''|''arg2''|...}} ]]</kbd><br />
| Include a [[d:Help:FAQ#Terminology|property]] ([[wp:Wikidata|Wikidata]]) from a named entity, instead of the default on the page.<br />
|-<br />
! scope="row" | <kbd>[[mw:Reading/Web/Projects/Read more|{<nowiki />{#related:...}}]]</kbd><br />
| Links to similar topics, to engage readers. (Beta feature.)<br />
|-<br />
! scope="row" | <kbd>[[Help:Labeled section transclusion|{{#section<nowiki />:}}{{zwsp}}{{#section-h<nowiki />:}}{{zwsp}}{{#section-x<nowiki />:}}]]</kbd><br />
| Aliases for <kbd><nowiki>{{#lst:}} {{#lsth}} {{#lstx}}</nowiki></kbd> (above).<br />
|-<br />
! scope="row" | <kbd>[[mw:Help:Extension:MassMessage#Parser_function_delivery_lists|{<nowiki />{#target:''fullpagename''}}]]</kbd><br />
| Send a message to a list of talk pages on the fullpagename, using the [[m:MassMessage|MassMessage function]].<br />
|-<br />
! scope="row" | <kbd>[[mw:Help:Magic_words#Localization|{<nowiki />{int:''pagename''}}]] </kbd><br />
| [[Wikipedia:Transclusion|Transclude]] an ''interface'' message , i.e. a [[Special:PrefixIndex/MediaWiki:|pagename in MediaWiki namespace]]<br />
|}<br />
<br />
==See also==<br />
* [[Help:Magic links]] for ISBN, PMID and RFC<br />
* [[mw:Localisation]]<br />
* [[mw:Manual:Extending wiki markup]]<br />
* [https://phabricator.wikimedia.org/diffusion/MW/history/master/includes/parser/CoreParserFunctions.php CoreParserFunctions.php]<br />
* [[User:Cacycle/wikEd|wikEd]], a MediaWiki editor with syntax highlighting for templates and parser functions<br />
* {{myprefs|Gadgets|Editing|check=Syntax highlighter}}<br />
* {{myprefs|Beta features|check=Wiki syntax highlighting}}<br />
* [[Special:Version]], at the bottom of the page, all the <kbd>{<nowiki/>{magic words}}</kbd> on this page are listed there as Parser function hooks<br />
* {{tl|Ifexist not redirect}}, works with the <nowiki>{{#ifexist:}}</nowiki> expression while allowing redirects to be identified and parsed differently<br />
<br />
{{Wikipedia technical help|collapsed}}<br />
<br />
[[Category:Wikipedia features]]<br />
<br />
[[he:עזרה:משתנים]]</div>en>Ahecht