A moratorium is in effect on adding information from Fire and Blood until December 20th.

Help: Variables

From A Wiki of Ice and Fire
Jump to: navigation, search

Variables are a type of Magic words a strings of text that Wiki software associates with a return value or function. There are three general types of magic words:

  • Variables: these are uppercase words surrounded by double braces, e.g. {{FOO}}. As such, they look a lot like templates. Note that templates use pre set parameters, that are parsed and cashed once you save the page, not each time you load it.
  • Behavior switches: these are uppercase words surrounded by double underscores, e.g. __FOO__ used for adjusting the layout or behavior of the page and can often be used to specify desired omissions and inclusions in the content.
  • Parser functions: very similar to variables, but take one or more parameters. See also Help:Extension:ParserFunctions which offers great functionality for constructing advance templates.


Here are some useful magic words, for a full list see Help:Magic words

Word Description
__NOTOC__ Hides the table of contents (TOC).
__FORCETOC__ Forces the table of content to appear at its normal position (above the first header).
__TOC__ Places a table of contents at the word's current position (overriding __NOTOC__). If this is used multiple times, the table of contents will appear at the first word's position. It is possible to suppress the auto-generated section numbers, if the proper class exists locally at MediaWiki:Common.css, defined as .tocnumber { display: none; }.
Variable Output Description
{{FULLPAGENAME}} Help:Variables Namespace and page title.
{{PAGENAME}} Variables Page title.
{{BASEPAGENAME}} Variables Page title excluding the current subpage and namespace ("Title/foo" on "Title/foo/bar").

For more complex splitting, use {{#titleparts}} from ParserFunctions extension.

{{SUBPAGENAME}} Variables The subpage title ("foo" on "Title/foo").
{{SUBJECTPAGENAME}} Help:Variables The namespace and title of the associated subject page.
{{TALKPAGENAME}} Help talk:Variables The namespace and title of the associated talk page.