Gaming
 

Help:Magic words

From WoWWiki

HELP CONTENTS · Getting Started · New to WoWWiki · Editing WoWWiki · Editing WoWWiki (advanced) · The WoWWiki Community · Additional Help
See Wikia Help for general Wikia- and wiki- related help. See http://meta.wikimedia.org/ Meta-Wiki HelpIntro for basic MediaWiki usage!


When adding wikicode while editing pages, certain "magic words" (sometimes called "reserved words" in programmer speak) do special things rather than just show up as they look normally.


Some commonly used examples of "magic words":

  • __NOTOC__ - suppresses automatic Table of Contents generation.
  • {{PAGENAME}} - inserts the current page name. As in: Magic words
  • {{PAGENAMEE}} - inserts the current page name in a wiki URL friendly form. As in: Magic_words
  • {{NAMESPACE}} - inserts the current name space name. As in: Help


See MediaWiki  Help:Magic words at Mediawiki.org for a detailed list.


NOTE: Whether these "magic words" work or not depends on the version of MediaWiki software that WoWWiki runs on. See WoWWiki MediaWiki version history for the current version in use.

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.

Contents

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}} Wikia Help The wiki's site name.
{{SERVER}} http://help.wikia.com domain URL
{{SERVERNAME}} help.wikia.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.15.1 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}} 12637 Unique revision ID 1.5+
{{REVISIONDAY}} 8 Day edit was made (unpadded number) 1.8+
{{REVISIONDAY2}} 08 Day edit was made (zero-padded number) 1.8+
{{REVISIONMONTH}} 10 Month edit was made (unpadded number) 1.8+
{{REVISIONYEAR}} 2009 Year edit was made 1.8+
{{REVISIONTIMESTAMP}} 20091008152751 Timestamp as of time of edit 1.8+
{{PAGESIZE:page name}} 6,684 [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}} → /MediaWiki
{{localurl:MediaWiki|printable=yes}} → http://help.wikia.com/index.php?title=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}} → http://help.wikia.com/wiki/Category:Top_level

{{fullurl:Category:Top level|action=edit}} → http://help.wikia.com/index.php?title=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}} → Wiki.png
{{filepath:Wiki.png|nowiki}} → http://images2.wikia.nocookie.net/help/images/b/bc/Wiki.png
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