Magic words

From Allotments4All

Jump to: navigation, search

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

04

CURRENTMONTHNAME

A variable.

April

CURRENTDAY

A variable.

24

CURRENTDAYNAME

A variable.

Wednesday

CURRENTYEAR

A variable.

2024

CURRENTTIME

A variable.

23:42

NUMBEROFARTICLES

A variable.

177

CURRENTMONTHNAMEGEN

A variable.

April

PAGENAME

A variable.

Magic words

PAGENAMEE

A variable. Like PAGENAME but with full language expansion to URL safe coding; see US-ASCII. 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.

Magic_words

NAMESPACE

A variable.


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

SUBST: 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.

INT:

A special template. Used for UI messages, works the same as "MediaWiki:".

{{INT:mainpage}} gives the content of MediaWiki:mainpage:
Main Page

SITENAME

A variable.

Allotments4All