Magic words

Offline MediaWiki Code Editor

Assistant for Magic Words
Previous Top Next

graphic
An assistant to insert magic words into a page.
Magic words are features of wiki markup that give instructions to Wikipedia's underlying MediaWiki software. Magic words are of three main kinds: "parser functions", "variables" and "behavior switches". These, for example, can suppress or position the table of contents, disable indexing by external search engines, and produce output dynamically based on the current page or on user-defined conditional logic. Some of these features are especially useful for templates.
Some magic words are case-insensitive, but not all. White
space is stripped from the start and end of keywords and
parameters, as in template syntax.
There are three main types of magic words:
·    Behavior switches
·    Variables
·    Parser functions
Behavior switches

Uppercase words surrounded by double underscores, e.g., __NOTOC__ or other keywords using parser function syntax.
Variables

Uppercase words surrounded by double braces (thus resembling templates), e.g. {{PAGENAME}}. Variables can be grouped into several types:

·    Page variables
·    Site variables
·    Date and time variables
·    Revision data variables
·    Statistics variables

Page-dependent magic words will affect or return data about the current page, even if the word is added through a transcluded template or included in a system message.

Parser functions


Keywords in double braces with parameters after a colon (some beginning with #), e.g. {{#expr:2+2}}.
It is possible to substitute parser functions and most variables in the same way that templates are substituted (using the subst: keyword). This causes their current value (as evaluated at the time of substitution) to be written into the wikitext.

Parser functions can be grouped into several types:
·    Metadata
·    Formating
·    Path (URL)
·    Conditional
·    Other functions

This assistant is a repository of more than one hundred Magic words you can use in your edition. These are grouped in twelve clusters, . Just select the magic word you want to use and click on <Insert Magic word> to insert the selected item into the Edit window.