Difference between revisions of "Template:Err/doc"

From blackwiki
Jump to navigation Jump to search
imported>NYKevin
(→‎Usage: new subsection operation)
imported>SMcCandlish
(indentation fix)
Line 17: Line 17:
 
Works fine if given wikitext, but with a few caveats:
 
Works fine if given wikitext, but with a few caveats:
 
#Wikitables, as usual, are broken; you need to use {{tl2|!}} to encode the | character, or switch to (X)HTML
 
#Wikitables, as usual, are broken; you need to use {{tl2|!}} to encode the | character, or switch to (X)HTML
##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.
+
#: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.
 
#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 it with 1=

Revision as of 15:05, 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

Works fine if given wikitext, but with a few caveats:

  1. Wikitables, as usual, are broken; you need to use {{!}} to encode the | character, or switch to (X)HTML
    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.
  2. Images work, but only their captions are formatted (how one is supposed to big/bold/red an image is questionable anyway)
  3. if an = appear anywhere in the error message, prefix it with 1=
  4. Links work as normal, but they won't turn red (usually)
  5. ''' ''' 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.
  6. Most wikitext works as expected.

See also