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 68: | Line 68: | ||
== Variables == | == Variables == | ||
− | : | + | {{Shortcut|WP:VAR}} |
+ | {{about|the MediaWiki variables used in Wikipedia|more documentation|mw:Help:Magic words#Variables}} | ||
The example outputs in the following table are those that would be produced on the page "{{FULLPAGENAME}}/subpage". | The example outputs in the following table are those that would be produced on the page "{{FULLPAGENAME}}/subpage". | ||
Line 96: | Line 97: | ||
| {{BASEPAGENAME:{{FULLPAGENAME}}/subpage}} | | {{BASEPAGENAME:{{FULLPAGENAME}}/subpage}} | ||
| Current page's name excluding namespace and any subpage element or elements (i.e. the first forward-slash ("/") and anything following; in effect, a subpage's parent's name less its namespace). | | Current page's name excluding namespace and any subpage element or elements (i.e. the first forward-slash ("/") and anything following; in effect, a subpage's parent's name less its namespace). | ||
+ | |- | ||
+ | | {{wikivar|ROOTPAGENAME}} | ||
+ | | {{ROOTPAGENAME:{{FULLPAGENAME}}/subpage}} | ||
+ | | Name of the root of the current page. Would return Foo on page Help:Foo/Bar/Baz | ||
|- | |- | ||
| {{wikivar|SUBPAGENAME}} | | {{wikivar|SUBPAGENAME}} | ||
Line 117: | Line 122: | ||
| Associated talk page's namespace. | | Associated talk page's namespace. | ||
|- | |- | ||
− | | {{wikivar|FULLPAGENAMEE}},<br/>{{wikivar|PAGENAMEE}},<br/> | + | | {{longitem|line-height:1.5em|{{wikivar|FULLPAGENAMEE}},<br/>{{wikivar|PAGENAMEE}},<br/>{{pad|0.4em}}(etc.)}} |
− | | {{FULLPAGENAMEE:{{FULLPAGENAME}}/subpage}},<br/>{{PAGENAMEE:{{FULLPAGENAME}}/subpage}},<br/>(etc.) | + | | {{longitem|line-height:1.5em|{{FULLPAGENAMEE:{{FULLPAGENAME}}/subpage}},<br/>{{PAGENAMEE:{{FULLPAGENAME}}/subpage}},<br/>(etc.)}} |
− | | Adding an E to the end of the above variables, renders the above encoded for use in MediaWiki | + | | 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). |
|}<!-- | |}<!-- | ||
− | -->''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 (''':''') is used to pass the parameter, rather than a pipe ('''|''') that is used in templates, like <code><nowiki>{{MAGICWORD:value}}</nowiki></code>. For example, <code><nowiki>{{TALKPAGENAME:Wikipedia:MOS}}</nowiki></code> returns <code><nowiki>Wikipedia talk:MOS</nowiki></code> on any page. See [ | + | -->''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|''':'''}}) is used to pass the parameter, rather than a pipe ({{thinsp|'''|'''}}) that is used in templates, like <code><nowiki>{{MAGICWORD:value}}</nowiki></code>. For example, <code><nowiki>{{TALKPAGENAME:Wikipedia:MOS}}</nowiki></code> returns <code><nowiki>Wikipedia talk:MOS</nowiki></code> on any page. See [[meta:Help:Page name]] for more details of parser functions. |
{| class=wikitable | {| class=wikitable | ||
Line 132: | Line 137: | ||
|- | |- | ||
| {{wikivar|SERVERNAME}} || {{SERVERNAME}} || | | {{wikivar|SERVERNAME}} || {{SERVERNAME}} || | ||
+ | |- | ||
+ | | {{wikivar|SCRIPTPATH}} || {{SCRIPTPATH}} || | ||
|- | |- | ||
| {{wikivar|CURRENTVERSION}} || {{CURRENTVERSION}} || Returns current MediaWiki version. | | {{wikivar|CURRENTVERSION}} || {{CURRENTVERSION}} || Returns current MediaWiki version. | ||
Line 140: | Line 147: | ||
! Date and time | ! Date and time | ||
! Revision data | ! Revision data | ||
− | ! Statistics | + | ! Statistics{{sup|b}} |
|- style="vertical-align:top" | |- style="vertical-align:top" | ||
| | | | ||
{| | {| | ||
| ''Universal time'' | | ''Universal time'' | ||
+ | {{startplainlist}} | ||
* {{wikivar|CURRENTYEAR}} | * {{wikivar|CURRENTYEAR}} | ||
* {{wikivar|CURRENTMONTH}} | * {{wikivar|CURRENTMONTH}} | ||
Line 157: | Line 165: | ||
* {{wikivar|CURRENTWEEK}} | * {{wikivar|CURRENTWEEK}} | ||
* {{wikivar|CURRENTTIMESTAMP}} | * {{wikivar|CURRENTTIMESTAMP}} | ||
+ | {{endplainlist}} | ||
| ''Local website time'' | | ''Local website time'' | ||
+ | {{startplainlist}} | ||
* {{wikivar|LOCALYEAR}} | * {{wikivar|LOCALYEAR}} | ||
* {{wikivar|LOCALMONTH}} | * {{wikivar|LOCALMONTH}} | ||
Line 170: | Line 180: | ||
* {{wikivar|LOCALWEEK}} | * {{wikivar|LOCALWEEK}} | ||
* {{wikivar|LOCALTIMESTAMP}} | * {{wikivar|LOCALTIMESTAMP}} | ||
+ | {{endplainlist}} | ||
|} | |} | ||
− | | | + | |{{startplainlist}} |
− | * {{wikivar|REVISIONID}} | + | * {{wikivar|REVISIONID}}{{sup|a}} |
* {{wikivar|REVISIONDAY}} | * {{wikivar|REVISIONDAY}} | ||
* {{wikivar|REVISIONDAY2}} | * {{wikivar|REVISIONDAY2}} | ||
Line 179: | Line 190: | ||
* {{wikivar|REVISIONTIMESTAMP}} | * {{wikivar|REVISIONTIMESTAMP}} | ||
* {{wikivar|REVISIONUSER}} | * {{wikivar|REVISIONUSER}} | ||
− | | | + | |{{startplainlist}} |
* {{wikivar|NUMBEROFPAGES}} | * {{wikivar|NUMBEROFPAGES}} | ||
* {{wikivar|NUMBEROFARTICLES}} | * {{wikivar|NUMBEROFARTICLES}} | ||
Line 188: | Line 199: | ||
* {{wikivar|NUMBEROFADMINS}} | * {{wikivar|NUMBEROFADMINS}} | ||
* {{wikivar|NUMBEROFACTIVEUSERS}} | * {{wikivar|NUMBEROFACTIVEUSERS}} | ||
+ | {{endplainlist}} | ||
|} | |} | ||
− | + | {{nowrap|{{sup|a}} {{wikivar|REVISIONID}} cannot be [[Wikipedia:Substitution|substituted]] and does not function in preview.<br/>{{sup|b}} English Wikipedia.}} | |
== Parser functions == | == Parser functions == |