Help:Magic words/es

Las magic words, –palabras mágicas, en castellano–, son strings –cadenas de texto– que MediaWiki asocia con un valor determinado, o el resultado devuelto por una función, como pueda ser la fecha, hora, detalles de la página, nombre del artículo, etcétera.

En esta página de ayuda, se listan las magic words de caracter standard en los proyectos wikimedia; para una documentación técnica y más extensiva, consultar.

Hay tres clases generales de magic words:
 * Behavior switches, –interruptores de comportamiento, en castellano–: son strings con sus caracteres en mayúsculas, y encerrados entre guiones bajos (ej: __FOO__)
 * Variables: son strings con su caracteres en mayúsculas, y encerrados entre doble corchete, (ej:  ).
 * Parser functions, –funciones del analizador sintáctico, en castellano–: pueden llevar parámetros, y son del tipo   or   . (ver documentación).

El contenido de las páginas que incluyan magic words variará y dependerá de la página en cuestión, y del momento en que se visualice, incluso si la palabra mágica se incluye a través de plantillas o mensajes del sistema.

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

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

Date & time
The following variables return the current date and time according to the user's timezone preferences, defaulting to the UTC timezone.

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 local timezone instead of user preferences and UTC:
 *  2024 
 *  August 
 *  
 *  
 *  </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

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

Statistics
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  ).

Page names
The following are URL-encoded equivalents:
 *  </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> ->

Namespaces
The following are URL-encoded equivalents:
 * <tt> </tt>
 * <tt> </tt>
 * <tt> </tt>

As of, these can all take a parameter, specifying the property should be returned for a given title instead of the current page:
 * <tt> </tt> ->

Parser functions
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 usually prefixed with a hash to distinguish them from possible 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.

Namespaces
returns the localized name for the namespace with that index.

Enlaces externos

 * w:es:Ayuda:Palabras mágicas