Community Central
Community Central
No edit summary
No edit summary
Line 114: Line 114:
 
| <tt><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></tt>
 
| <tt><nowiki>{{DISPLAYTITLE:</nowiki>''title''<nowiki>}}</nowiki></tt>
 
|
 
|
| Format the current page's title header. The value must be equivalent to the default title: only capitalization changes and replacing spaces with underscores. It can be disabled or enabled by {{mediawiki|Manual:$wgAllowDisplayTitle|$wgAllowDisplayTitle}}; disabled by default before 1.10+, enabled by default thereafter.
+
| 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+
 
| 1.7+
 
|-
 
|-
 
| <tt><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></tt><br /><tt><nowiki>{{DEFAULTSORTKEY:</nowiki>''sortkey''<nowiki>}}</nowiki></tt><br /><tt><nowiki>{{DEFAULTCATEGORYSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></tt>
 
| <tt><nowiki>{{DEFAULTSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></tt><br /><tt><nowiki>{{DEFAULTSORTKEY:</nowiki>''sortkey''<nowiki>}}</nowiki></tt><br /><tt><nowiki>{{DEFAULTCATEGORYSORT:</nowiki>''sortkey''<nowiki>}}</nowiki></tt>
 
|
 
|
| Used for categorizing pages, sets a default [[Help:Categories|category sort key]]. For example if you put <tt><nowiki>{{DEFAULTSORT:Smith, John}}</nowiki></tt> at the end of [[John Smith]], the page would be sorted under "S" by default in categories.
+
| Used for categorizing pages, sets a default [[Help:Categories|category sort key]]. For example if you put <tt><nowiki>{{DEFAULTSORT:Smith, John}}</nowiki></tt> at the end of a page called 'John Smith', the page would be sorted under "S" by default in categories.
 
| 1.10+
 
| 1.10+
 
|}
 
|}
Line 163: Line 163:
 
*[[mw:Help:Magic words|Help:Magic words]] on MediaWiki.org - for a full list of available magic words.
 
*[[mw:Help:Magic words|Help:Magic words]] on MediaWiki.org - for a full list of available magic words.
 
[[de:Hilfe:Zauberwörter]]
 
[[de:Hilfe:Zauberwörter]]
[[Category:Help|{{PAGENAME}}]]
+
[[Category:Help|false]]
[[Category:Expand|{{PAGENAME}}]]
+
[[Category:Expand|false]]

Revision as of 23:56, 31 August 2009

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 (&lrm; on left-to-right wikis, &rlm; 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}} 31 Day edit was made (unpadded number) 1.8+
{{REVISIONDAY2}} 31 Day edit was made (zero-padded number) 1.8+
{{REVISIONMONTH}} 08 Month edit was made (unpadded number) 1.8+
{{REVISIONYEAR}} 2009 Year edit was made 1.8+
{{REVISIONTIMESTAMP}} 20090831235659 Timestamp as of time of edit 1.8+
{{PAGESIZE:page name}} 6,641 [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).


See also