Template:Error
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
{{#invoke:Error|error|{{{1}}}|tag=}}
The template returns a state of error (recognized as such by a wiki parser function), and optionally an error-message text in red (visible for the user).
Usage
{{error|An exemplary error}}
→ {{#invoke:Error|error|An exemplary error|tag=}}{{error|message=An exemplary error}}
→ {{#invoke:Error|error|An exemplary error|tag=}}- Compare, used in a Parser Function:
{{#expr:Foo}}
→ Expression error: Unrecognised word "foo". {{#iferror:{{error|Foo}} | {{y}} | {{n}} }}
→ Template:N
Tag option
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 e.g. by #expre
. To prevent strong
message, use one of the other tags, e.g. tag=span
.
- ABC
{{error|An exemplary error demo no tag (default)}}
XYZ → ABC {{#invoke:Error|error|An exemplary error demo no tag (default)|tag=}} XYZ - ABC
{{error|An exemplary error demo span|tag=span}}
XYZ → ABC {{#invoke:Error|error|An exemplary error demo span|tag=span}} XYZ - ABC
{{error|An exemplary error demo div|tag=div}}
XYZ → ABC {{#invoke:Error|error|An exemplary error demo div|tag=div}} XYZ - ABC
{{error|An exemplary error demo p|tag=p}}
XYZ → ABC {{#invoke:Error|error|An exemplary error demo p|tag=p}} XYZ - ABC
{{error|An exemplary error demo strong|tag=strong}}
XYZ → ABC {{#invoke:Error|error|An exemplary error demo strong|tag=strong}} XYZ
See also
The above documentation is transcluded from Template:Error/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |