Magicwords are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page explains only the standard magic words; for a technical reference, see Manual:Magic words .
Variables and parser functions can use subst:, just like templates. Page-dependent magic words will affect or return data about the current page (by default), even if the word is added through a transcluded template or included system message.
A behavior switch controls the layout or behavior of the page (if supported by the skin) and can often be used to specify desired omissions and inclusions in the content. Notably some of these are not supported by the Minerva skin.
Variables return information about the current page, wiki, or date. Their syntax is similar to templates. Variables marked as "[expensive]" are tracked by the software, and the number that can be included on a page is limited.
For more thorough time formatting, or to output the current year and week with better compliance with ISO-8601, you may want to install Extension:ParserFunctions to use the #time parser function.
It can take a second argument of noerror or noreplace to suppress error messages when multiple displaytitles are used on one page or to make this displaytitle do nothing if a displaytitle was already specified earlier in the page.
Parser functions are very similar to variables but take one or more parameters (technically, any magic word that takes a parameter is a parser function), and the name is sometimes prefixed with a hash to distinguish them from templates.
This page only describes parser functions that are integral to the MediaWiki software. Other parser functions may be added by MediaWiki extensions such as the Extension:ParserFunctions . For those see Help:Extension:ParserFunctions .
If you really need to format (according the wiki's locale) a number in unknown input format, you could try and use formatnum two times (but not if it can have a decimal group, or its separator will be eaten or the number won't be formatted). Be aware that this is more a hack than a regular way to proceed, thus the output may be not reliable.
Here are the magic words which are used as main localisation tools. Other magic words will often depend on the wiki's locale and configuration or on the chosen language: see in particular #Date and time, #Formatting, #Miscellaneous. More magic words are added by the Extension:Translate .
Recorded in English in the late 1600s, abracadabra is used in incantations, particularly as a magical means of warding off misfortune, harm, or illness, and for some, is used as a nonsense word, implying gibberish in place of supposedly magical words.
Perhaps one of the greatest magical commands to survive from folklore, open sesame today may be used as a noun to refer to a very successful means of achieving a result. For instance, you might say an MBA is the open sesame to landing a competitive job in finance.
Similar to abracadabra in popularity and structure, calamaris is the word that Scandinavians would invoke to heal a fever. Also like abracadabra, this word was a reductive spell, meaning the full word would be written down on one line, then each successive line would have one letter removed.
The unique word caracteres refers to symbols written on bits of parchment or amulets. They were used as a way of encoding powerful spells to keep them from being repeated by someone who may not be aware of their potency or seek to abuse their power. Because of this general barrier to entry, caracteres also demanded the potential conjurors devote time to studying and learning how to correctly interpret the encrypted incantations.
Magic words are a technique for mapping a variety of wiki text strings to a single ID that is associated with a function.Both variables and parser functions use this technique.All text mapped to that ID will be replaced with the return value of the function.The mapping between the text strings and the ID is stored in the variable $magicWords in a file that can be loaded using $wgExtensionMessagesFiles[] .
Where possible you should follow the conventions when defining or translating magic words.Magic words are higher in priority than templates, so any magic word defined, will block the usage of that defined name as a template.
The variable $magicWords is used to associate each magic word ID with a language-dependent array that describes all the text strings that mapped to the magic word ID.Important: This only sets up the back end i18n mapping, you still have to write other code to make MediaWiki use the magic word for anything.Also, make sure that you initialize $magicWords as an empty array before adding language-specific values or you will get errors when trying to load the magic word and will need to rebuild your localization cache before it will work.
The first element of this array is an integer flag indicating whether or not the magic word is case sensitive. The remaining elements are a list of text that should be associated with the magic word ID. If the case sensitive flag is 0, any case variant of the names in the array will match. If the case sensitive flag is 1, only exact case matches will be associated with the magic word ID.Thus the format is $magicWords['en'] = [ 'InternalName' => [ 0, 'NameUserTypes', 'AdditionalAliasUserCanType' ] ];
In the example below, a Spanish MediaWiki installation will associate the magic word ID 'MAG_CUSTOM' with "personalizado", "custom", "PERSONALIZADO", "CUSTOM" and all other case variants.In an English MediaWiki only "custom" in various case combinations will be mapped to 'MAG_CUSTOM':
Note that "ExampleMagic" is a different to the key you would use for a plain internationalization file (normally just the title of the extension, i.e. "Example"). "Magic" has been appended deliberately so one does not overwrite the other.
These magic words typically do not output any content, but instead change the behavior of a page and/or set a page property.These magic words are listed in MagicWordFactory::mDoubleUnderscoreIDs and also at Help:Magic words#Behavior switches.The effect of most standard behavior switches is defined in Parser::handleDoubleUnderscore().If no specific effect is defined, the magic word will simply set a page property in the page_props table.This can also be checked later by testing if $parser->getOutput()->getPageProperty( 'MAGIC_WORD' ) is null or the empty string
Magic words (including parser functions, variables and behavior switches) are features of wiki markup that give instructions to Wikipedia's underlying MediaWiki software. For example, magic words 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.
Magic words can sometimes behave weirdly when substituted or nested. It's possible to subst some magic words (so that the page stops being updated if the value of the word changes). Here are some examples of how this works:
Welcome! This page will get you started with some common phrases you'll run into while playing Magic. From "haste" to "exile" to "flying", you'll find quick answers for exploring the world's greatest TCG!
A keyword ability found on creatures. Creatures with double strike deal their combat damage twice. When you reach the combat damage step, check to see if any attacking or blocking creatures have first strike or double strike. If so, an extra combat damage step is created just for them. Only creatures with first strike and double strike get to deal combat damage during this step. After that, the normal combat damage step happens. All other attacking and blocking creatures that survived, as well as the ones with double strike, deal combat damage during this second step.
A keyword ability found on creatures. Creatures with first strike deal all of their combat damage before creatures without first strike or double strike. When you reach the combat damage step, check to see if any attacking or blocking creatures have first strike or double strike. If so, an extra combat damage step is created just for them.
Only creatures with first strike and double strike get to deal combat damage during this step. After that, the normal combat damage step happens. All other attacking and blocking creatures that survived, as well as the ones with double strike, deal combat damage during this second step.
The magical energy you use to pay for spells and some abilities is called mana. Most mana comes from tapping lands. There are five colors of mana: (white), (blue), (black), (red), and (green). Some nonbasic lands make (colorless mana), which can be spent to pay costs that don't require mana of a specific color. Unspent mana vanishes between turns and phases, so you can't 'save' mana from one turn to use during a later turn.
3a8082e126