Difference between revisions of "Template:Err/doc"

From blackwiki
Jump to navigation Jump to search
imported>SMcCandlish
(indentation fix)
imported>SMcCandlish
(→‎Operation: dox cleanup)
Line 15: Line 15:
  
 
====Operation====
 
====Operation====
Works fine if given wikitext, but with a few caveats:
+
Most wikitext works as expected, with a few caveats:
#Wikitables, as usual, are broken; you need to use {{tl2|!}} to encode the | character, or switch to (X)HTML
+
#Use {{tl2|!}} to encode the | character
#:The formatting does not apply to tables at all (it might be possible to fix that by switching from <span> to <div>), so it might be easier to not bother.
+
#A table cannot be placed in the message.
 
#Images work, but only their captions are formatted (how one is supposed to big/bold/red an ''image'' is questionable anyway)
 
#Images work, but only their captions are formatted (how one is supposed to big/bold/red an ''image'' is questionable anyway)
#if an = appear anywhere in the error message, prefix it with 1=
+
#If an = appear anywhere in the error message, prefix the message with 1=
 
#Links work as normal, but they won't turn red ([[WP:REDLINK|usually]])
 
#Links work as normal, but they won't turn red ([[WP:REDLINK|usually]])
 
#<nowiki>''' '''</nowiki> can be used to "cancel" bolding for a single word; note that at the moment such behavior breaks nesting; in other words, this is subject to change at any time as MediaWiki's parser engine is updated and the template itself repaired etc.
 
#<nowiki>''' '''</nowiki> can be used to "cancel" bolding for a single word; note that at the moment such behavior breaks nesting; in other words, this is subject to change at any time as MediaWiki's parser engine is updated and the template itself repaired etc.
#Most wikitext works as expected.
 
  
 
=== See also ===
 
=== See also ===

Revision as of 15:08, 27 January 2010

Usage

Use this template when you need to show a serious (fatal) error resulting from improper user input. Usually, it is best to simply show the error message from the appropriate parser function (in which case this template is not needed), but there are times when custom error messages are useful. Please do not use this on article pages directly, as it is likely quite useless and probably in violation of content policies.

{{err|error message}}

produces:

error message

This should be more specific than the default, and if possible, should give instructions for a "quick fix". There are no real rules for error messages, but, by analogy with the errors arising from parser functions, it appears that capitalization of the first letter is preferred.

Operation

Most wikitext works as expected, with a few caveats:

  1. Use {{!}} to encode the | character
  2. A table cannot be placed in the message.
  3. Images work, but only their captions are formatted (how one is supposed to big/bold/red an image is questionable anyway)
  4. If an = appear anywhere in the error message, prefix the message with 1=
  5. Links work as normal, but they won't turn red (usually)
  6. ''' ''' can be used to "cancel" bolding for a single word; note that at the moment such behavior breaks nesting; in other words, this is subject to change at any time as MediaWiki's parser engine is updated and the template itself repaired etc.

See also