Help:Magic Words

This is a summary of magic words that are unique to UESP. All of the standard MediaWiki magic words are also available, as listed at Wikimedia. Most of these magic words are added by one of two UESP custom extensions, namely UespCustomCode and MetaTemplate. More details on these magic words may be provided on the extension documentation pages.

 
Variables
Page Names


Namespace
Two namespace-related variables are added by MetaTemplate


The rest of the namespace-related variables are all added by the UespNamespace class in UespCustomCode. In all cases:
The definitions of the namespaces are provided by  (which can be updated by the site's admins). The definition list can include both true namespaces and mods which contain articles that are subpages of the mod's main page (e.g., Tes3Mod:Tamriel Rebuilt).
The variables are designed so that mods listed in uespnamespacelist can be treated as if they were true namespaces, in particular within templates. These are often referred to interchangeably as mod namespaces, pseudo-namespaces, or just pseudo-spaces.
These variable names must be upper case. Either an underscore (_) or a space ( ) can be used interchangeably.
There are three possible ways that these magic words can identify the requested namespace:
# Any of the magic words can be called with an argument ("arg" in the following examples) which specifies the desired namespace. The argument can be the basic name of the namespace ( ) or the ID of the namespace ( ). This option overrides any other options.
# If the magic word is called without an argument, then the code checks to see whether the template variables   or   have been set (the variables must be all lowercase; ns_base takes precedence over ns_id). If so, these variables are used to determine the namespace.
# If neither of the above conditions is met, then the default behavior is to automatically identify the namespace (or mod) for the article, and return values appropriate for that namespace. For talk page articles, the corresponding SUBJECTSPACE is always used, instead of the talk namespace.



Other
The NESTLEVEL magic word is added by the MetaTemplate Extension


Parser Functions


Parser Subroutines
These are all technically parser functions, but for all of these parser subroutines, the return value (the text displayed in the article) is always an empty string. The purpose of these subroutines is not to directly display content in the article, but rather to do various types of behind-the-scenes processing.



Tag Functions
{| class=wikitable
!Word !! Example !! Explanation
|-
|   > ...   
|
 
 
 
|Cleans the leading & trailing whitespace as well as line breaks when used in templates (see Tag Functions).
|-
|   > ...   
|
 
 
 
|Removes rows from a table if the non-header cells contain only empty strings. Rows with only headers in them are never removed, only rows which have one or more non-header cells, all of which are blank.

Here is what the code to the left would look like if the first variable was blank and the second was equal to "abc":
 
|-
|   > ...   
|     
|If used on , the code to the left would cause the template page to display the code of the template, much as if you'd used &lt;nowiki> tags around the entire template. Unlike &lt;nowiki>, however, this will not affect the template's function, only the display on its own page. Note that proper documentation is generally preferable.
|-
|   > ...   
|   
|This would set the title for each entry in the category to just the page name, excluding the namespace or pseudo-namespace. Note that without a corresponding  , the example would present a straight category list with no group headers.
|}