Community Central
Community Central

A "magic word" is a symbol recognized by the MediaWiki software and which triggers the software to do something other than display that symbol.

Some of the most commonly used examples are listed below.

Popular magic words

Behavior switches

Examples:
  • __NOTOC__ hides the table of contents on a page.
  • __TOC__ places the table of contents exactly where this is entered. It overrides the NOTOC switch.

It is important to note that it is two underscores on either side, and that it must be all capitals. Most of the behavior switches that Wikia uses are standard (find them here). Due to extensions, however, there are a few extra, such as __NOWYSIWYG__, which disables the rich text editor.

Variables

  • {{CURRENTDAYNAME}} produces the current day of the week.
  • {{NUMBEROFARTICLES}} shows the number of articles on your wiki.
  • {{SITENAME}} produces the name of the wiki.

Full list of variables

Technical metadata

Revision variables return data about the latest edit to the current page, even if viewing an older version of the page.

Variable Output Description Versions
Site
{{SITENAME}} Community Central The wiki's site name.
{{SERVER}} https://community.fandom.com domain URL
{{SERVERNAME}} community.fandom.com domain name
{{DIRMARK}}
{{DIRECTIONMARK}}

Outputs a unicode-directional mark that matches the wiki's default language's direction (‎ on left-to-right wikis, ‏ on right-to-left wikis), useful in text with multi-directional text. 1.7+
{{SCRIPTPATH}} relative script path
{{CURRENTVERSION}} 1.39.7 The wiki's MediaWiki version. 1.7+
{{CONTENTLANGUAGE}}
{{CONTENTLANG}}
en
en
The wiki's default interface language 1.7+
Latest revision to current page
{{REVISIONID}} - Unique revision ID 1.5+
{{REVISIONDAY}} 6 Day edit was made (unpadded number) 1.8+
{{REVISIONDAY2}} 06 Day edit was made (zero-padded number) 1.8+
{{REVISIONMONTH}} 01 Month edit was made (unpadded number) 1.8+
{{REVISIONYEAR}} 2011 Year edit was made 1.8+
{{REVISIONTIMESTAMP}} 20110106113122 Timestamp as of time of edit 1.8+
{{PAGESIZE:page name}} 6,714 [expensive] Returns the byte size of the specified page.
Affects page content
{{DISPLAYTITLE:title}} Format the current page's title header. The value must be equivalent to the default title: only capitalization changes and replacing spaces with underscores. 1.7+
{{DEFAULTSORT:sortkey}}
{{DEFAULTSORTKEY:sortkey}}
{{DEFAULTCATEGORYSORT:sortkey}}
Used for categorizing pages, sets a default category sort key. For example if you put {{DEFAULTSORT:Smith, John}} at the end of a page called 'John Smith', the page would be sorted under "S" by default in categories. 1.10+

URL data

Parser function Input → Output Description Versions
{{localurl:page name}}
{{localurl:page name|query string}}
{{localurl:MediaWiki}} → /wiki/MediaWiki
{{localurl:MediaWiki|printable=yes}} → /wiki/MediaWiki?printable=yes
The relative path to the title.
{{fullurl:page name}}
{{fullurl:page name|query_string}}
{{fullurl:interwiki:remote page name|query_string}}
{{fullurl:Category:Top level}} → https://community.fandom.com/wiki/Category:Top_level

{{fullurl:Category:Top level|action=edit}} → https://community.fandom.com/wiki/Category:Top_level?action=edit

The absolute path to the title. This will also resolve Interwiki prefixes. 1.5+
{{filepath:file name}}
{{filepath:file name|nowiki}}
{{filepath:Wiki.png}} → latest?cb=20210831201421
{{filepath:Wiki.png|nowiki}} → https://static.wikia.nocookie.net/central/images/b/bc/Wiki.png/revision/latest?cb=20210831201421
The absolute URL to a media file.
{{urlencode:string}} {{urlencode:x y z}} → x+y+z The input encoded for use in URLs.
{{anchorencode:string}} {{anchorencode:x y z}} → x_y_z The input encoded for use in URL section anchors (after the '#' symbol in a URL).

Media:Example.ogg

See also