Editing Help:Magic words

Jump to: navigation, search

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 ==
: ''For more documentation, see [[mw:Help:Magic words#Variables|this Wikipedia page]].
+
{{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/>&nbsp;&nbsp;&nbsp;(etc.)
+
  | {{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 URLs (i.e. with underscores replacing spaces).
+
  | 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 ('''&#124;''') 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 [https://meta.wikimedia.org/wiki/Help:Page_name meta:Help:Page name] for more details of parser functions.
+
-->''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|'''&#124;'''}}) 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}}<sup>a</sup>
+
* {{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}}
 
|}
 
|}
<sup>a</sup> {{wikivar|REVISIONID}} cannot be [[help:Substitution|substituted]] and does not function in preview.
+
{{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 ==

Please note that all contributions to Gunsopedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Gunsopedia:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox