Template:MC/Error
More actions
{{{1}}}
The template returns a state of error, and optionally an error-message text in red (visible for the user).
Usage
The parameter Template:P can be set to the error to display when using this template.
- Template:Tl → Template:Error
- Compare, used in a Parser Function:
{{#expr:Foo}}→ Expression error: Unrecognized word "foo".
If Template:P is unset, no error will be displayed, although it still can be detected by {{#iferror:}}
#iferror
The error displayed is detected by the parser function {{#iferror:}}.
{{#iferror: {{error|Foo}} | {{c|yes}} | {{c|no}} }}→ Template:C{{#iferror: {{error}} | {{c|yes}} | {{c|no}} }}→ Template:C
Tag option
The tag to contain the error message can be given through the Template:P parameter, but it will only accept span, div, p, and strong, since those are the only tags recognized by the {{#iferror:}} parser function. It defaults to strong, the tag generated by most parsers, e.g. by {{#expr:}}.
| Code | Result |
|---|---|
| ABC Template:Tl XYZ | ABC Template:Error XYZ |
| ABC Template:Tl XYZ | ABC Template:Error XYZ |
| ABC Template:Tl XYZ | ABC Template:Error XYZ |
| ABC Template:Tl XYZ | ABC Template:Error XYZ |
| ABC Template:Tl XYZ | ABC Template:Error XYZ |
See also
cs:Šablona:Error fr:Modèle:Erreur it:Template:Errore ja:テンプレート:Error ko:틀:Error lzh:模板:Error pt:Predefinição:Erro ru:Шаблон:Error th:แม่แบบ:Error uk:Шаблон:Error
zh:Template:ErrorIf you're done making changes, please refresh the text.
Please add categories and interwikis to Template:MC/Error/doc. (View all subpages of this page.)