VOOZH about

URL: https://minecraft.wiki/w/Template:Error

⇱ Template:Error – Minecraft Wiki


Template:Error

From Minecraft Wiki
Jump to navigation Jump to search

{{{1}}}

Documentation[view] [edit] [history] [purge]


The template returns a state of error, and optionally an error-message text in red (visible for the user).

The parameter |1= can be set to the error to display when using this template.

  • {{|An exemplary error}}An exemplary error
  • Compare, used in a Parser Function: {{#expr:Foo}}Expression error: Unrecognized word "foo".

If |1= is unset, no error will be displayed, although it still can be detected by {{#iferror:}}

  • {{}}

#iferror

[edit source]

The error displayed is detected by the parser function {{#iferror:}}.

  • {{#iferror: {{error|Foo}} | {{c|yes}} | {{c|no}} }}👁 Image
     Yes
  • {{#iferror: {{error}} | {{c|yes}} | {{c|no}} }}👁 Image
     Yes

Tag option

[edit source]

The tag to contain the error message can be given through the |tag= 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 {{|An exemplary error demo no tag (default)}} XYZ ABC An exemplary error demo no tag (default) XYZ
ABC {{|An exemplary error demo span|tag=span}} XYZ ABC An exemplary error demo span XYZ
ABC {{|An exemplary error demo div|tag=div}} XYZ ABC
An exemplary error demo div
XYZ
ABC {{|An exemplary error demo p|tag=p}} XYZ ABC

An exemplary error demo p

XYZ
ABC {{|An exemplary error demo strong|tag=strong}} XYZ ABC An exemplary error demo strong XYZ

See also

[edit source]
[view] [edit] [history] [purge]The above documentation is transcluded from Template:Error/doc.
Retrieved from "https://minecraft.wiki/w/Template:Error?oldid=3098036"

Navigation menu