Difference between revisions of "Template:Error"

From Appropedia
Jump to navigation Jump to search
(copy from wikipedia:Template:Error; need this for other templates' documentation subpages)
 
 
Line 1: Line 1:
<{{#switch:{{lc:{{{tag}}}}}
+
<{{#switch:{{lc:{{{tag}}}}}
    |p=p
+
|p=p
    |span=span
+
|span=span
    |div=div
+
|div=div
    |#default=strong
+
|#default=strong
  }} class="error"><!--
+
}} class="error">{{{message|{{{1}}}}}}</{{#switch:{{lc:{{{tag}}}}}
-->{{{message|{{{1}}}}}}<!--
+
|p=p
--></{{#switch:{{lc:{{{tag}}}}}
+
|span=span
    |p=p
+
|div=div
    |span=span
+
|#default=strong
    |div=div
+
}}><noinclude>
    |#default=strong
+
{{documentation}}
  }}><noinclude>
 
 
 
{{documentation}}
 
 
</noinclude>
 
</noinclude>

Latest revision as of 15:41, 14 February 2013

{{{1}}}

Template documentation[edit]

Create a parser function error message.

Usage[edit source]

  • {{error|An exemplary error}}An exemplary error
  • Compare: {{#expr:Foo}}Expression error: Unrecognized word "foo".

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
  • {{error|An exemplary error div|tag=div}}
    An exemplary error div
  • {{error|An exemplary error p|tag=p}}

    An exemplary error p

  • {{error|An exemplary error strong|tag=strong}}An exemplary error strong

See also[edit source]

External links[edit source]