Template:Error/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Amalthea
m tweak
meta>Amalthea
info about allowed tags
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
Create a [[Help:Parser function|parser function]] error message.


=== Usage ===
=== Usage ===
Create a standard parser function error message.
* {{tlx|error|An examplary error}} → {{error|An examplary error}}
* {{tlx|error|An examplary error}} → {{error|An examplary error}}
* {{tlx|error|An examplary error span|3=tag=span}} → {{error|An examplary error div|tag=span}}
* Compare: <nowiki>{{#expr:Invalid}}</nowiki> → {{#expr:Foo}}
* Compare: <nowiki>{{#expr:Invalid}}</nowiki> → {{#expr:Foo}}
* <nowiki>{{#iferror:{{error|Foo}} | {{y}} | {{n}} }}</nowiki> → {{#iferror:{{error|Foo}} | {{y}} | {{n}} }}
* <nowiki>{{#iferror:{{error|Foo}} | {{y}} | {{n}} }}</nowiki> → {{#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 genereated e.g. by <code>#expre</code>.
* {{tlx|error|An examplary error span|3=tag=span}} → {{error|An examplary error div|tag=span}}
== See also ==
* [[Help:Parser function]]
* [[mw:Help:Extension:ParserFunctions##iferror:]]


<includeonly>
<includeonly>

Revision as of 13:07, 12 May 2009

Create a parser function error message.

Usage

  • {{error|An examplary error}}An examplary error
  • Compare: {{#expr:Invalid}} → Expression error: Unrecognized word "foo".
  • {{#iferror:{{error|Foo}} | {{y}} | {{n}} }} → Green tickY

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 genereated e.g. by #expre.

  • {{error|An examplary error span|tag=span}}An examplary error div

See also