Plantilla:Error

De Terraria Wiki
Ir a la navegación Ir a la búsqueda
Esta plantilla tiene su i18n preparado, lo que significa que es fácil de localizar para diferentes lenguas. Por favor vea I18n & l10n para plantillas (en) para aprender más.
Véase Plantilla:Error/l10n para la localización de esta plantilla.
Important.svg
CUIDADO: ¡¡¡El código de la Wiki Terraria es complejo!!!
Si quieres utilizar este código en otra wiki, el staff de wiki.gg no podrá brindarte asistencia.
Por favor considera otra wiki a la cual adaptar su código, ¡o crea tus propias plantillas!
Recuerda que el contenido de una wiki es más importante que el formato elegante.
Template-info.svg Documentación La siguiente documentación es transcluida de Plantilla:Error/doc. (editar | historia)

A helper template to display an error, generally to be used from inside other templates. Categorizes the page in Category:Páginas con errores de plantilla.

Usage

{{ error | <error text> | <additional category> }}

or

{{ error | text=<error text> | cate=<additional category> }}

First unnamed parameter or text

Error message to display. Will be wrapped in a span.

title

Hover text.

from or source

Short string denoting the source of the error. If this parameter is provided, the page will be categorized in a "Páginas con errores de $source" category. Additionally, the span output tag will be extended to include a data-source attribute holding this parameter's value. This facilitates, for instance, easy access of errors from the same source via JavaScript or CSS.

Second, third, ..., n-th unnamed parameter and cate, cate2, ..., cate<n>

Additional categories to categorize the page in, can be continued ad infinitum. Set $cate to n or no to prevent categorization altogether.

Examples

Code Result Categories added
{{error|Something went wrong!}} !!Error: Something went wrong!
{{error|Something went wrong!|from=MyTemplate}} !!Error: Something went wrong!
{{error|Something went wrong!|from=MyTemplate|cate=n}} !!Error: Something went wrong! n/a
{{error|Something went wrong!|from=MyTemplate|cate=Things to do|cate2=Pages with script errors}} !!Error: Something went wrong!

Error handling

The output of this template is compatible with the {{#iferror:}} parser function, which can be used to catch and handle errors.

Code Result
{{error|Fault!}} !!Error: Fault!
{{#iferror:{{error|Fault!}}|There is something wrong!|Everything is OK.}} There is something wrong!
{{#iferror:{{error|Fault!}}|There is something wrong!}} There is something wrong!
{{#iferror: {{error|Fault!}} }} (no output)