Page is a draft due to changes in included resources
You are viewing an old version of this page. Return to the latest version.
No categories assigned
Magic words
-
- Last edited 5 years ago by MLR
-
-
- This page is a draft but has an approved version
Revision as of 09:09, 14 October 2019 by Mlink-rodrigue (talk | contribs)
What are magic words?
A "magic word" is a symbol recognized by the MediaWiki software. It triggers the software to do something other than display that symbol, or transclude a page with that name, but instead to use the symbol directly.
There are four types of magic words:
Type of magic word | Syntax | Example magic word | Example output |
---|---|---|---|
variable | {{FOO}}
|
{{FULLPAGENAME}}
|
Training:EN/MagicWords |
| |||
tag | <foo>
|
<tagsearch cat="Training">
|
|
| |||
behavior switch | __FOO__
|
__NOTOC__
|
hides the table of contents (TOC) |
| |||
parser function | {{foo:...}}
or
|
{{#dateformat:date|ISO 8601}}
|
2019-12-31 |
{{{#userslink:(who?)}
|
shows all users who are online | ||
{{#hwinfobox:}}
|
shows five latest changes with the dates | ||
{{#ifeq:{{{type}}}|warning
|This is a warning!
|
}}
|
How to add a magic word
Magic words are inserted directly in the source code. Some frequently used magic words can also be added directly with the VisualEditor "Insert > Magic word" menu item: