Help:Variables/id

Kata magis adalah untaian teks yang dikaitkan MediaWiki dengan suatu nilai atau fungsi balikan, seperti waktu, detail situs, atau nama laman. Laman ini menguraikan penggunaan kata magis standar; untuk rujukan teknis, lihat.

There are three general types of magic words:
 * Sakelar perilaku: these are uppercase words surrounded by double underscores, e.g. __FOO__
 * Variabel: these are uppercase words surrounded by double braces, e.g.  . As such, they look a lot like templates.
 * Fungsi parser: these take parameters and are either of the form   or   . See also.

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.

Sakelar perilaku
A behavior switch controls the layout or behaviour of the page and can often be used to specify desired omissions and inclusions in the content.

Variabel
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.

If a template name conflicts with a variable, the variable will be used (so to transclude the template    :PAGENAME you would need to write  ). In some cases, adding parameters will force the parser to treat a variable as a template; for example,  transcludes     :CURRENTDAYNAME.

Tanggal & waktu
The following variables return the current date and time in UTC.

Due to MediaWiki and browser caching, these variables frequently show when the page was cached rather than the current time.

The following variables do the same as the above, but using the site's server config or $wgLocaltimezone.
 *  2024 
 *  August 
 *  </tt>
 *  </tt>
 *  </tt>
 *  27 </tt>
 *  </tt>
 *  </tt>
 *  Tuesday </tt>
 *  </tt>
 *  </tt>
 *  </tt>
 *  </tt>


 * For more thorough time formatting, you may want to install Extension:ParserFunctions to use the #time parser function

Metadata teknis
Revision variables return data about the latest edit to the current page, even if viewing an older version of the page.

Statistik
Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example,  &rarr;  and   &rarr; ). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example  and  ).

Judul laman
The  </tt> and   </tt> magic words only work in namespaces that have subpages enabled. See for information on enabling subpages.

The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters percent-encoded):
 *  </tt>
 *  </tt>
 *  </tt>
 * <tt> </tt>
 * <tt> </tt>
 * <tt> </tt>

As of, these can all take a parameter, allowing specification of the page to be operated on, instead of just the current page:
 * <tt> </tt> &rarr; 

Ruang nama
The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded):
 * <tt> </tt>
 * <tt> </tt>
 * <tt> </tt>

As of, these can take a page name parameter and will return the namespace of the page name parameter, instead of the current page's:
 * <tt> </tt> &rarr; 
 * <tt> </tt> &rarr; 
 * <tt> </tt> &rarr; 

Fungsi parser
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. For those see Help:Extension:ParserFunctions.

Ruang nama
<tt>     </tt> returns the localized name for the namespace with that index. <tt> </tt> is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.