Help:Magic words

From The Giant: The Definitive Obey Giant Site

Jump to: navigation, search

This is an index of Magic words used in MediaWiki.

Contents

#redirect

Indicates a redirect

__NOTOC__

Hides the table of contents.

__FORCETOC__

Always show the table of contents.

__TOC__

Place the table of contents here.

__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.

12

CURRENTMONTHNAME

A variable.

December

CURRENTDAY

A variable.

22

CURRENTDAYNAME

A variable.

Sunday

CURRENTYEAR

A variable.

2024

CURRENTTIME

A variable.

{{CURRENTTIME}}=06:03

NUMBEROFARTICLES

A variable.

2,478

CURRENTMONTHNAMEGEN

A variable.

December

PAGENAME

A variable.

{{PAGENAME}} = Magic words

PAGENAMEE

A variable.

This Page= Magic_words

NAMESPACE

A variable.

This Page = Help

MSG:

A template modifier, i.e. {{msg:stub}} shows

{{Stub}}


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 "December" 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.

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

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

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

MSGNW:

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

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


{{msgnw:stub}}


__END__

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

thumbnail

An image modifier. 'Thumb' has the same effect.

[[Image:ImageName.jpg|thumbnail|Mediawiki]]

right

An image modifier.

[[Image:ImageName.jpg|right|Mediawiki]]

left

An image modifier.

[[Image:Mediawiki.png|left|Mediawiki]]

none

An image modifier.

[[Image:Mediawiki.png|none|Mediawiki]]

1px

An image modifier.

[[Image:Mediawiki.png|142px|Mediawiki]]

center

An image modifier. Can also be spelled centre.

[[Image:Mediawiki.png|center|Mediawiki]]

framed

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


[[Image:Mediawiki.png|framed|Mediawiki]]

INT:

A special template. Used for UI messages.

mainpage:
Main Page

SITENAME

A variable.

{{SITENAME}} = The Giant: The Definitive Obey Giant Site

NS:

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

4:
The Giant: The Definitive Obey Giant Site

LOCALURL:

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

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

yields

/wiki/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}}

yields

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

SERVER

A variable. {{SERVER}} produces http://thegiant.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, returning the number of the current week (1-52).

51

CURRENTDOW

A variable, returning the number of the current day of the week (0=Sunday, 1=Monday).

0

Since v1.5

CURRENTMONTHABBREV

A variable that returns the abbreviation of the current month.

Dec

FULLURL:, FULLURLE:

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

{{FULLURL:page}}

REVISIONID

Gives you the article or diff database

7703

SCRIPTPATH

Returns $wgScriptPath

/wiki

SERVERNAME

Returns $wgServerName

thegiant.org

NUMBEROFFILES

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

3,941