:Help:Magic words for beginners
{{For|more detailed information on magic words|Help:Magic words}}
{{Wikipedia how-to|H:MWFB|H:MAGICBEGIN}}
Magic words are words surrounded by brackets or underscores which most often insert or display the current value of what they are called. These include parser functions, variables and behavior switches and are features of wikitext. They are interpreted by the Metawiki software and are often used in templates so that they show different information depending on which page they are on and many other conditions.
Types
There are three types of magic words:
- Behavior switches: uppercase words surrounded by double underscores, like.
__NOTOC__ - Variables: uppercase words surrounded by double braces, like
and function somewhat similarly to templates.{{PAGENAME}} - Parser functions: These include expressions and consist of keywords (some beginning #) in double braces with parameters following a colon, ex.
{{#expr:2+2}}
Things to remember
- Most magic words may be case-sensitive.
:*
- Whitespace is not counted in from the front and back of keywords and parameters and the same also applies to template code.
:*
- Page-dependent magic words will change or show information about the current page, even if the word is from a template, though in most cases, this is the desired effect.
:*If I insert
- If you want a magic word to paste in its value at the time of saving, you can substitute it in the same way that templates are substituted (using the
subst:
keyword).
:*
Behavior switches
For a more detailed explanation, refer to the behavior switches MediaWiki page.
=Table of contents=
(can be placed anywhere in the wikitext; prevents a table of contents)__NOTOC__
(can be placed anywhere in the wikitext; makes a table of contents appear in its normal position)__FORCETOC__
(places a table of contents at its position)__TOC__
==Edit/section links==
(hides section edit links beside headings)__NOEDITSECTION__
(adds a "+" or "new section" link for adding a new section on a non-talk page)__NEWSECTIONLINK__
(removes the "+" or "new section" link on "Talk" pages)__NONEWSECTIONLINK__
==Categories and indexing==
(on category pages, replaces thumbnails with normal links)__NOGALLERY__
(on category pages, makes it a hidden category)__HIDDENCAT__
(tells search engines to index the page (show in results))__INDEX__
(tells search engines not to index the page (not show in results))__NOINDEX__
==Titles and sorting==
(changes the displayed form of the page title){{DISPLAYTITLE: title}}
(sets a default category sorting key){{DEFAULTSORT: sortkey}}
Variables
File:Nuvola apps edu mathematics blue-p.svg
File:Icon Mathematical Plot.svg
For documentation, you may wish to read the variables MediaWiki page.
(The page title, including namespace.){{FULLPAGENAME}}
:*Shown here: {{FULLPAGENAME}} (Ex. User:QwerpQwertus/Adoption)
(page title without namespace){{PAGENAME}}
:*Shown here: {{PAGENAME}} (Ex. User:QwerpQwertus/Adoption)
(the page title without the current subpage or namespace — the parent page without the namespace.){{BASEPAGENAME}}
:*Shown here: {{BASEPAGENAME}} (Ex. User:QwerpQwertus/Adoption)
(subpage part of title){{SUBPAGENAME}}
:*Shown here: {{SUBPAGENAME}} (Ex. User:QwerpQwertus/Adoption)
(associated non-talk page){{SUBJECTPAGENAME}}
:*Shown here: {{SUBJECTPAGENAME}} (Ex. "Talk:Wikipedia" makes "Wikipedia")
(associated talk page){{TALKPAGENAME}}
:*Shown here: {{TALKPAGENAME}} (Ex. "Wikipedia" makes "Talk:Wikipedia")
(namespace of current page){{NAMESPACE}}
:*Shown here: {{NAMESPACE}} (Ex. User:QwerpQwertus/Adoption makes "User")
(associated non-talk namespace){{SUBJECTSPACE}}, {{ARTICLESPACE}}
:*Shown here: {{SUBJECTSPACE}}, {{ARTICLESPACE}} (Ex. User talk:QwerpQwertus/Adoption makes "User")
(associated talk namespace){{TALKSPACE}}
:*Shown here: {{TALKSPACE}} (Ex. "Wikipedia" makes "Talk:Wikipedia")
etc. (URL-encoded equivalents){{FULLPAGENAMEE}}, {{NAMESPACEE}}
:*Shown here: {{FULLPAGENAMEE}} (Ex. "Wikipedia" makes "
See also
For more detailed information on all magic words (behaviour switches, variables and parser functions), consider reading:
- Help:Magic words: a more detailed help page.
- mw:Help:Magic words: details of all available MediaWiki standard magic words.
- mw:Help:Extension:ParserFunctions: parser function extensions to MediaWiki, to supplement magic words.
- mw:Manual:Extending wiki markup: extending MediaWiki wiki markup by adding to standard tokens.
{{Help navigation}}
{{Wikipedia technical help|collapsed}}