Help:Magic Words: Difference between revisions

m
Adjust to our formatting
(Copied from MediaWiki)
m (Adjust to our formatting)
Line 15: Line 15:
A behavior switch controls the layout or behaviour of the page and can often be used to specify desired omissions and inclusions in the content.
A behavior switch controls the layout or behaviour of the page and can often be used to specify desired omissions and inclusions in the content.


{| {{prettytable}}
{| class="prettytable"
|-
|-
!{{Hl2}}| Word
!| Word
!{{Hl2}}| Description
!| Description
!{{Hl2}}| Versions
!| Versions
|-
|-
|{{Hl3}} colspan="3"| '''Table of contents'''
| colspan="3"| '''Table of contents'''
|-
|-
| <nowiki>__NOTOC__</nowiki>
| <nowiki>__NOTOC__</nowiki>
Line 35: Line 35:
|
|
|-
|-
|{{Hl3}} colspan="3"| '''Editing'''
| colspan="3"| '''Editing'''
|-
|-
| <nowiki>__NOEDITSECTION__</nowiki>
| <nowiki>__NOEDITSECTION__</nowiki>
Line 49: Line 49:
| {{mediawiki|rev:47522|1.15+}}
| {{mediawiki|rev:47522|1.15+}}
|-
|-
|{{Hl3}} colspan="3"| '''Categories'''
| colspan="3"| '''Categories'''
|-
|-
| <nowiki>__NOGALLERY__</nowiki>
| <nowiki>__NOGALLERY__</nowiki>
Line 59: Line 59:
| 1.13+
| 1.13+
|-
|-
|{{Hl3}} colspan="3"| '''Language conversion'''
| colspan="3"| '''Language conversion'''
|-
|-
| <nowiki>__NOCONTENTCONVERT__</nowiki><br /><nowiki>__NOCC__</nowiki>
| <nowiki>__NOCONTENTCONVERT__</nowiki><br /><nowiki>__NOCC__</nowiki>
Line 69: Line 69:
|
|
|-
|-
|{{Hl3}} colspan="3"| '''Other'''
| colspan="3"| '''Other'''
|-
|-
| <nowiki>__START__</nowiki>
| <nowiki>__START__</nowiki>
Line 102: Line 102:
Due to MediaWiki and browser caching, these variables frequently show when the page was ''cached'' rather than the current time.
Due to MediaWiki and browser caching, these variables frequently show when the page was ''cached'' rather than the current time.


{| {{prettytable}}
{| class="prettytable"
|-
|-
!{{Hl2}}| Variable
!| Variable
!{{Hl2}}| Output
!| Output
!{{Hl2}}| Description
!| Description
!{{Hl2}}| Versions
!| Versions
|-
|-
|{{Hl3}} colspan="4"| '''Year'''
| colspan="4"| '''Year'''
|-
|-
| <tt><nowiki>{{CURRENTYEAR}}</nowiki></tt>
| <tt><nowiki>{{CURRENTYEAR}}</nowiki></tt>
Line 116: Line 116:
|
|
|-
|-
|{{Hl3}} colspan="4"| '''Month'''
| colspan="4"| '''Month'''
|-
|-
| <tt><nowiki>{{CURRENTMONTH}}</nowiki></tt>
| <tt><nowiki>{{CURRENTMONTH}}</nowiki></tt>
Line 138: Line 138:
| 1.5+
| 1.5+
|-
|-
|{{Hl3}} colspan="4"| '''Day'''
| colspan="4"| '''Day'''
|-
|-
| <tt><nowiki>{{CURRENTDAY}}</nowiki></tt>
| <tt><nowiki>{{CURRENTDAY}}</nowiki></tt>
Line 160: Line 160:
|
|
|-
|-
|{{Hl3}} colspan="4"| '''Time'''
| colspan="4"| '''Time'''
|-
|-
| <tt><nowiki>{{CURRENTTIME}}</nowiki></tt>
| <tt><nowiki>{{CURRENTTIME}}</nowiki></tt>
Line 172: Line 172:
|
|
|-
|-
|{{Hl3}} colspan="4"| '''Other'''
| colspan="4"| '''Other'''
|-
|-
| <tt><nowiki>{{CURRENTWEEK}}</nowiki></tt>
| <tt><nowiki>{{CURRENTWEEK}}</nowiki></tt>
Line 204: Line 204:
===Technical metadata===
===Technical metadata===
Revision variables return data about the '''latest edit to the current page''', even if viewing an older version of the page.
Revision variables return data about the '''latest edit to the current page''', even if viewing an older version of the page.
{| {{prettytable}}
{| class="prettytable"
|-
|-
!{{Hl2}}| Variable
!| Variable
!{{Hl2}}| Output
!| Output
!{{Hl2}}| Description
!| Description
!{{Hl2}}| Versions
!| Versions
|-
|-
|{{Hl3}} colspan="4"| '''Site'''
| colspan="4"| '''Site'''
|-
|-
| <tt><nowiki>{{SITENAME}}</nowiki></tt>
| <tt><nowiki>{{SITENAME}}</nowiki></tt>
Line 253: Line 253:
| 1.7+
| 1.7+
|-
|-
|{{Hl3}} colspan="4"| '''Latest revision to current page'''
| colspan="4"| '''Latest revision to current page'''
|-
|-
| <tt><nowiki>{{REVISIONID}}</nowiki></tt>
| <tt><nowiki>{{REVISIONID}}</nowiki></tt>
Line 305: Line 305:
| {{mediawiki|rev:45587|1.15+}}
| {{mediawiki|rev:45587|1.15+}}
|-
|-
|{{Hl3}} colspan="4"| '''Affects page content'''
| colspan="4"| '''Affects page content'''
|-
|-
| <tt><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></tt>
| <tt><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></tt>
Line 320: Line 320:
===Statistics===
===Statistics===
Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, <code><tt><nowiki>{{NUMBEROFPAGES}}</nowiki></tt></code> &rarr; {{NUMBEROFPAGES}} and <code><tt><nowiki>{{NUMBEROFPAGES:R}}</nowiki></tt></code> &rarr; {{NUMBEROFPAGES:R}}). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example <code><tt><nowiki>{{PAGESINCATEGORY:Help}}</nowiki></tt></code> and <code><tt><nowiki>{{PAGESINCATEGORY:Help|R}}</nowiki></tt></code>).
Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, <code><tt><nowiki>{{NUMBEROFPAGES}}</nowiki></tt></code> &rarr; {{NUMBEROFPAGES}} and <code><tt><nowiki>{{NUMBEROFPAGES:R}}</nowiki></tt></code> &rarr; {{NUMBEROFPAGES:R}}). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example <code><tt><nowiki>{{PAGESINCATEGORY:Help}}</nowiki></tt></code> and <code><tt><nowiki>{{PAGESINCATEGORY:Help|R}}</nowiki></tt></code>).
{| {{prettytable}}
{| class="prettytable"
|-
|-
!{{Hl2}}| Variable
!| Variable
!{{Hl2}}| Output
!| Output
!{{Hl2}}| Description
!| Description
!{{Hl2}}| Versions
!| Versions
|-
|-
|{{Hl3}} colspan="4"| '''Entire wiki'''
| colspan="4"| '''Entire wiki'''
|-
|-
| <tt><nowiki>{{NUMBEROFPAGES}}</nowiki></tt>
| <tt><nowiki>{{NUMBEROFPAGES}}</nowiki></tt>
Line 386: Line 386:


===Page names===
===Page names===
{| {{prettytable}}
{| class="prettytable"
|-
|-
!{{Hl2}}| Variable
!| Variable
!{{Hl2}}| Output
!| Output
!{{Hl2}}| Description
!| Description
!{{Hl2}}| Versions
!| Versions
|-
|-
| <tt><nowiki>{{FULLPAGENAME}}</nowiki></tt>
| <tt><nowiki>{{FULLPAGENAME}}</nowiki></tt>
Line 442: Line 442:


===Namespaces===
===Namespaces===
{| {{prettytable}}
{| class="prettytable"
|-
|-
!{{Hl2}}| Variable
!| Variable
!{{Hl2}}| Output
!| Output
!{{Hl2}}| Description
!| Description
!{{Hl2}}| Versions
!| Versions
|-
|-
| <tt><nowiki>{{NAMESPACE}}</nowiki></tt>
| <tt><nowiki>{{NAMESPACE}}</nowiki></tt>
Line 482: Line 482:


===URL data===
===URL data===
{| {{prettytable}}
{| class="prettytable"
|-
|-
!{{Hl2}}| Parser function
!| Parser function
!{{Hl2}}| Input → Output
!| Input → Output
!{{Hl2}}| Description
!| Description
!{{Hl2}}| Versions
!| Versions
|-
|-
| <tt><nowiki>{{localurl:</nowiki>''page name''<nowiki>}}</nowiki></tt><br /><tt><nowiki>{{localurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></tt>
| <tt><nowiki>{{localurl:</nowiki>''page name''<nowiki>}}</nowiki></tt><br /><tt><nowiki>{{localurl:</nowiki>''page name''<nowiki>|</nowiki>''query_string''<nowiki>}}</nowiki></tt>
Line 518: Line 518:
===Namespaces===
===Namespaces===
<tt><nowiki>{{ns:}}</nowiki></tt> returns the localized name for the [[Help:Namespace|namespace]] with that index. <tt><nowiki>{{nse:}}</nowiki></tt> is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.
<tt><nowiki>{{ns:}}</nowiki></tt> returns the localized name for the [[Help:Namespace|namespace]] with that index. <tt><nowiki>{{nse:}}</nowiki></tt> is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.
{| {{prettytable}}
{| class="prettytable"
|-
|-
! {{hl3}} colspan="2" width="50%" | Content namespaces
! colspan="2" width="50%" | Content namespaces
! rowspan="12" |
! rowspan="12" |
! {{hl3}} colspan="2" width=%50%" | Talk namespaces
! colspan="2" width=%50%" | Talk namespaces
|-
|-
!{{Hl2}}| Usage
!| Usage
!{{Hl2}}| Output
!| Output
!{{Hl2}}| Usage
!| Usage
!{{Hl2}}| Output
!| Output
|-
|-
| <tt><nowiki>{{ns:-2}}</nowiki></tt> or <tt><nowiki>{{ns:Media}}</nowiki></tt>
| <tt><nowiki>{{ns:-2}}</nowiki></tt> or <tt><nowiki>{{ns:Media}}</nowiki></tt>
Line 578: Line 578:
===Formatting===
===Formatting===
<!--Well gosh, with the source of the examples hidden, who can tell what you are inputting without looking here in the source?-->
<!--Well gosh, with the source of the examples hidden, who can tell what you are inputting without looking here in the source?-->
{| {{prettytable}}
{| class="prettytable"
!{{Hl2}}| Usage
!| Usage
!{{Hl2}}| Input → Output
!| Input → Output
!{{Hl2}}| Description
!| Description
!{{Hl2}}| Version
!| Version
|-
|-
|-
|-
Line 654: Line 654:


===Miscellaneous===
===Miscellaneous===
{| {{prettytable|class="plainlinks"}}
{| class="prettytable plainlinks"
!{{Hl2}}| Usage
!| Usage
!{{Hl2}}| Output
!| Output
!{{Hl2}}| Description
!| Description
!{{Hl2}}| Version
!| Version
|-
|-
| <tt><nowiki>{{int:</nowiki>''message name''<nowiki>}}</nowiki>
| <tt><nowiki>{{int:</nowiki>''message name''<nowiki>}}</nowiki>