Template:Error
{{{1}}}
| This template is used on approximately 43,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
| This template uses Lua: |
This meta-template returns a state of error (recognized as such by the wiki parser function {{#iferror}}), and optionally an error-message text in red (visible to the user). It is used by other templates to signal an error (such as those caused by invalid input), which can then either be displayed to the editor or caught and handled by other templates.
Usage
{{error|An exemplary error}}→ An exemplary error{{error|message=An exemplary error}}→ An exemplary error- Compare, used in a Parser Function:
{{#expr:Foo}}→ Expression error: Unrecognized word "foo". {{#iferror:{{error|Foo}} | {{y}} | {{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 {{#expr}}. 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 An exemplary error demo no tag (default) XYZ - ABC
{{error|An exemplary error demo span|tag=span}}XYZ → ABC An exemplary error demo span XYZ - ABC
{{error|An exemplary error demo div|tag=div}}XYZ → ABCAn exemplary error demo divXYZ - ABC
{{error|An exemplary error demo p|tag=p}}XYZ → ABCAn exemplary error demo p
XYZ - ABC
{{error|An exemplary error demo strong|tag=strong}}XYZ → ABC An exemplary error demo strong XYZ
TemplateData
TemplateData for Error
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)
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Message | 1 message | Error message text in red | String | suggested |
| Tag | tag | The tag to contain the error message; 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 #expr
| String | optional |
See also
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.