Template:Error/doc: Difference between revisions
Template page
More actions
m +cs: |
typos |
||
| Line 5: | Line 5: | ||
=== Usage === | === Usage === | ||
* {{tlx|error|An | * {{tlx|error|An exemplary error}} → {{error|An exemplary error}} | ||
* Compare: <code><nowiki>{{#expr:Foo}}</nowiki></code> → {{#expr:Foo}} | * Compare: <code><nowiki>{{#expr:Foo}}</nowiki></code> → {{#expr:Foo}} | ||
* <code><nowiki>{{#iferror:{{error|Foo}} | {{y}} | {{n}} }}</nowiki></code> → {{#iferror:{{error|Foo}} | {{y}} | {{n}} }} | * <code><nowiki>{{#iferror:{{error|Foo}} | {{y}} | {{n}} }}</nowiki></code> → {{#iferror:{{error|Foo}} | {{y}} | {{n}} }} | ||
The tag to contain the error message can be given through the <code>tag</code> parameter, but it will only accept <code>span</code>, <code>div</code>, <code>p</code>, and <code>strong</code>, since those are the only tags recognized by the <code>#iferror</code> parser function. It defaults to <code>strong</code>, the tag | The tag to contain the error message can be given through the <code>tag</code> parameter, but it will only accept <code>span</code>, <code>div</code>, <code>p</code>, and <code>strong</code>, since those are the only tags recognized by the <code>#iferror</code> parser function. It defaults to <code>strong</code>, the tag generated e.g. by <code>#expre</code>. | ||
* {{tlx|error|An | * {{tlx|error|An exemplary error span|3=tag=span}} → {{error|An exemplary error span|tag=span}} | ||
== See also == | === See also === | ||
* [[Help:Parser function]] | * [[Help:Parser function]] | ||
* [[mw:Help:Extension:ParserFunctions##iferror:]] | * [[mw:Help:Extension:ParserFunctions##iferror:]] | ||
Revision as of 09:06, 23 April 2010
Create a parser function error message.
Usage
- {{error|An exemplary error}} → An exemplary error
- Compare:
{{#expr:Foo}}→ Expression error: Unrecognized word "foo". {{#iferror:{{error|Foo}} | {{y}} | {{n}} }}→ Template:Y
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.
- {{error|An exemplary error span|tag=span}} → An exemplary error span
See also