Changes

Jump to: navigation, search

Help:Magic words

6,848 bytes added, 06:54, 25 April 2006
no edit summary
[[Category:Help]]{{Editor toc}}
This is an index of Magic words used in {{SITENAME}}.

== <nowiki>#redirect</nowiki> ==
Indicates a [[Help:Redirect|redirect]]

== <nowiki>__NOTOC__</nowiki> ==
Hides the table of contents.

== <nowiki>__FORCETOC__</nowiki> ==
Always show the table of contents.

== <nowiki>__TOC__</nowiki> ==
Place the table of contents here. See also [[Help:Magic_words#Compact_TOC|compact TOC]]

== <nowiki>__NOEDITSECTION__</nowiki> ==
Hide the edit links.

== <nowiki>__START__</nowiki> ==
<nowiki>__START__</nowiki> does nothing, and it is considered a magic word only because it has an ID in <tt>MagicWord.php</tt> (<code>MAG_START</code>).

== <nowiki>CURRENTMONTH</nowiki> ==
A [[Help:Variable|variable]].

{{CURRENTMONTH}}

== <nowiki>CURRENTMONTHNAME</nowiki> ==
A [[Help:Variable|variable]].

{{CURRENTMONTHNAME}}

== <nowiki>CURRENTDAY</nowiki> ==
A [[Help:Variable|variable]].

{{CURRENTDAY}}

== <nowiki>CURRENTDAYNAME</nowiki> ==
A [[Help:Variable|variable]].

{{CURRENTDAYNAME}}

== <nowiki>CURRENTYEAR</nowiki> ==
A [[Help:Variable|variable]].

{{CURRENTYEAR}}

== <nowiki>CURRENTTIME</nowiki> ==
A [[Help:Variable|variable]].

{{CURRENTTIME}}

== <nowiki>NUMBEROFARTICLES</nowiki> ==
A [[Help:Variable|variable]].

{{NUMBEROFARTICLES}}

== <nowiki>CURRENTMONTHNAMEGEN</nowiki> ==
A [[Help:Variable|variable]].

{{CURRENTMONTHNAMEGEN}}

== <nowiki>PAGENAME</nowiki> ==
A [[Help:Variable|variable]].

{{PAGENAME}}

== <nowiki>PAGENAMEE</nowiki> ==
A [[Help:Variable|variable]]. Like PAGENAME but with full language expansion to URL safe coding. If used in multiply-nested template, will be expanded in the context of the page you're actually looking at (the highest level page in the template stack); this is likely true for all magic words.

{{PAGENAMEE}}

== <nowiki>NAMESPACE</nowiki> ==
A [[Help:Variable|variable]].

{{NAMESPACE}}

== <nowiki>MSG:</nowiki> ==
A [[Help:Template|template]] modifier, i.e. <nowiki>{{msg:stub}}</nowiki> shows

<nowiki>{{Stub}}</nowiki>
----
The use of msg has an effect when a template name clashes with a magic word. For example, if <nowiki>[[Template:CURRENTMONTHNAME]]</nowiki> contained "Test", then <nowiki>{{CURRENTMONTHNAME}}</nowiki> would display "{{CURRENTMONTHNAME}}" but <nowiki>{{msg:CURRENTMONTHNAME}}</nowiki> would display "Test".

== <nowiki>SUBST:</nowiki> ==
A template modifier. Replaces the <i>reference</i> to the template (e.g. <nowiki>{{subst:template}}</nowiki>) with the <i>content</i> of the template.

e.g. <nowiki>{{subst:stub}}</nowiki> copies the <nowiki>{{stub}}</nowiki> contents below to the article, without using the template.

''This article is a [http://en.wikipedia.org/wiki/Wikipedia:Stub stub]. You can [http://en.wikipedia.org/wiki/Wikipedia:Find_or_fix_a_stub help] Wikimedia by [http://en.wikipedia.org/w/wiki.phtml?title=Template:Stub&action=edit expanding it].''

SUBST: can be helpful to avoid the overuse of meta-templates.

== <nowiki>MSGNW:</nowiki> ==
A template modifier. Causes the template source to be pasted.

So <nowiki><pre>{{msgnw:stub}}</pre></nowiki> outputs:
----
<nowiki>{{msgnw:stub}}</nowiki>
----

== <nowiki>__END__</nowiki> ==
Allows for trailing whitespace to be deliberately included in the page save.

== <nowiki>INT:</nowiki> ==
A special [[Help:Template|template]]. Used for UI messages, works the same as "{{SITENAME}}".

<code><nowiki>{{INT:mainpage}}</nowiki></code> gives the content of [[{{SITENAME}}:main_page]]:<br />
{{INT:mainpage}}

== <nowiki>SITENAME</nowiki> ==
A [[Help:Variable|variable]].

{{SITENAME}}

== <nowiki>NS:</nowiki> ==
A special [[Help:Template|template]]. Gets the name of a given namespace number.

<code><nowiki>{{NS:4}}</nowiki></code> gives:<br />
{{NS:4}}

== <nowiki>LOCALURL:</nowiki> ==
A special [[Help:Template|template]]. Gets the local URL of the given page.

<pre>{{localurl:Help:Magic words|section=0}}</pre>
yields
{{localurl:Help:Magic words|section=0}}

== <nowiki>LOCALURLE:</nowiki> ==
A special [[Help:Template|template]]. Gets the local URL of the given page.

<pre>{{localurle:Help:Magic words|section=0}}</pre>
yields
{{localurle:Help:Magic words|section=0}}

== <nowiki>SERVER</nowiki> ==
A [[Help:Variable|variable]].
<nowiki>{{SERVER}}</nowiki> produces
{{SERVER}}

== <nowiki>GRAMMAR:</nowiki> ==

Useful for inflected languages to derive word forms. Usage: <nowiki>{{grammar:case|word}}</nowiki>, cases in which this could be used depend on the specific language.

E. g. in Czech language, <nowiki>{{grammar:1sg|Wikipedie}}</nowiki> outputs ''Wikipedie'', while <nowiki>{{grammar:7sg|Wikipedie}}</nowiki> outputs Wikipedií.

== <nowiki>__NOTITLECONVERT__</nowiki> ==
? Can also be spelled <nowiki>__NOTC__</nowiki>.

Same as below __NOCC__ but Article Title only.

== <nowiki>__NOCONTENTCONVERT__</nowiki> ==
? Can also be spelled <nowiki>__NOCC__</nowiki>.

Don't perform the content language(character & phase) conversion in article display.(eg, Chinese zh with zh_cn, zh_tw, zh_sg, zh_hk)

== <nowiki>CURRENTWEEK</nowiki> ==
A [[Help:Variable|variable]], returning the number of the current week (1-52).

{{CURRENTWEEK}}

== <nowiki>CURRENTDOW</nowiki> ==
A [[Help:Variable|variable]], returning the number of the current day of the week (0=Sunday, 1=Monday).

{{CURRENTDOW}}

= Image Modifiers =
== <nowiki>thumbnail</nowiki> ==
An [[Help:Images_and_other_uploaded_files|Images]] modifier. 'Thumb' has the same effect.

[[Image:120px-RedDashRing.png|thumbnail|{{SITENAME}}]]{{clear}}

== <nowiki>right</nowiki> ==
An image modifier.


[[Image:120px-RedDashRing.png|right|{{SITENAME}]]{{clear}}

== <nowiki>left</nowiki> ==
An image modifier.

[[Image:120px-RedDashRing.png|left]]{{clear}}

== <nowiki>none</nowiki> ==
An image modifier.

[[Image:120px-RedDashRing.png|none|{{SITENAME}]]{{clear}}

== <nowiki>$1px</nowiki> ==
An image modifier.

[[Image:120px-RedDashRing.png|120px|{{SITENAME}}]]{{clear}}

== <nowiki>center</nowiki> ==
An image modifier. Can also be spelled <nowiki>centre</nowiki>.

[[Image:120px-RedDashRing.png|center|{{SITENAME}}]]{{clear}}

== <nowiki>framed</nowiki> ==
An image modifier. Can also be spelled <nowiki>enframed</nowiki> or <nowiki>frame</nowiki>.


[[Image:120px-RedDashRing.png|framed|{{SITENAME}}]]{{clear}}

=Since v1.5=

==CURRENTMONTHABBREV==
A [[Help:Variable|variable]] that returns the abbreviation of the current month.

{{CURRENTMONTHABBREV}}

==FULLURL:, FULLURLE:==
Special [[Help:Template|template]]s that give the full URL of the given page.

{{FULLURL:page}}

==REVISIONID==
Gives you the article or diff database

{{REVISIONID}}

==SCRIPTPATH==
Returns $wgScriptPath

{{SCRIPTPATH}}

==SERVERNAME==
Returns $wgServerName

{{SERVERNAME}}

==NUMBEROFFILES==
Returns the number of uploaded files (rows in the image table).

{{NUMBEROFFILES}}


==See also==
*[[Help:Variable]]
Root Admin, Bots, Bureaucrats, flow-bot, oversight, Administrators, Widget editors
24,656
edits

Navigation menu