Jump to content

Help:Magic words

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Uncle G's 'bot (talk | contribs) at 22:30, 24 November 2005 (TRANSWIKI: Copied from Meta:Help:Magic words.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:H:h

This is an index of Magic words used in MediaWiki.

#redirect

Indicates a redirect

__NOTOC__

Hides the table of contents.

__FORCETOC__

Always show the table of contents.

__TOC__

Place the table of contents here. See also compact TOC

__NOEDITSECTION__

Hide the edit links.

__START__

__START__ does nothing, and it is considered a magic word only because it has an ID in MagicWord.php (MAG_START).

CURRENTMONTH

A variable.

05

CURRENTMONTHNAME

A variable.

May

CURRENTDAY

A variable.

29

CURRENTDAYNAME

A variable.

Thursday

CURRENTYEAR

A variable.

2025

CURRENTTIME

A variable.

14:43

NUMBEROFARTICLES

A variable.

7,000,861

CURRENTMONTHNAMEGEN

A variable.

May

PAGENAME

A variable.

Magic words

PAGENAMEE

A variable.

Magic_words

NAMESPACE

A variable.

Help

MSG:

A template modifier. I.e. {{msg:stub}} shows


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

SUBST:

A template modifier. Replaces the reference to the template (e.g. {{subst:template}}) with the content of the template.

This article is a stub. You can help Wikimedia by expanding it.

MSGNW:

A template modifier. Causes the template source to be pasted.

So

{{msgnw:stub}}

outputs:


{{asbox | image = | pix = | subject = | article = article | qualifier = | category = Stubs | tempsort = no | lowercase = y | name = Template:Stub }}


__END__

Allows for trailing whitespace to be deliberately included in the page save.

thumbnail

An image modifier.

Mediawiki

An image modifier.

Mediawiki
Mediawiki

left

An image modifier.

Mediawiki
Mediawiki

none

An image modifier.

Mediawiki
Mediawiki

$1px

An image modifier.

Mediawiki

center

An image modifier. Can also be spelled centre.

Mediawiki
Mediawiki

framed

An image modifier. Can also be spelled enframed or frame.


Mediawiki

INT:

A special template. Used for UI messages.

mainpage:
Main Page

SITENAME

A variable.

Wikipedia

NS:

A special template. Gets the name of a given namespace number.

4:
Wikipedia

LOCALURL:

A special template. Gets the local URL of the given page.

{{localurl:Help:Magic words|section=0}}

results into

/w/index.php?title=Help:Magic_words&section=0

LOCALURLE:

A special template. Gets the local URL of the given page.

{{localurle:Help:Magic words|section=0}}

results into

/w/index.php?title=Help:Magic_words&section=0

SERVER

A variable. {{SERVER}} produces //en.wikipedia.org

GRAMMAR:

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

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

__NOTITLECONVERT__

? Can also be spelled __NOTC__.

Same as below but Article Title only.

__NOCONTENTCONVERT__

? Can also be spelled __NOCC__.

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

CURRENTWEEK

A variable.

22

CURRENTDOW

A variable.

4


Since v1.5

CURRENTMONTHABBREV

A variable, returns the abbreviation of the current month.

May

FULLURL:, FULLURLE:

Special templates, give the full URL of the given page.

//en.wikipedia.org/wiki/Page

REVISIONID

Gives you the article or diff database

-

SCRIPTPATH

Returns $wgScriptPath

/w

SERVERNAME

Returns $wgServerName

en.wikipedia.org

NUMBEROFFILES

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

937,630

Template:H:f