Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 22:28, 5 August 2025 by imported>MarkusRost (Revert edits by Ghastler (talk))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{{{1}}}

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]

Template:Documentation header

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:TlTemplate: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:Error
The above text is transcluded from Template:MC/Error/doc; you can change it or view its history.
If 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.)