Predloga:FormattingError

Iz Wikipedije, proste enciklopedije
Jump to navigation Jump to search

Napaka v predlogi

Documentation icon Dokumentacija predloge[predogled] [uredi] [zgodovina] [osveži]

Outputs an error message in red into the page and adds the page to Kategorija:Strani z nepravilno uporabo predlog za oblikovanje. An anchor (FormattingError) is inserted at the start of the error message, so you can find any errors on a page easily by adding #FormattingError at the end of the URL (e.g. Predloga:val/testniprimeri#Error messages). Used in complex templates that check their arguments for validity, so incorrect use can be spotted while editing a page or afterwards.

Usage[uredi kodo]

  • {{FormattingError|error message}}

or

  • {{FormattingError|error message|nocategory=true}}

When using the nocategory argument, the error message is displayed as usual, but the page is not added to Kategorija:Strani z nepravilno uporabo predlog za oblikovanje. This is useful in documentation pages for templates that use FormattingError and show what errors they can generate without adding these documentation pages to the category. For an example of this, see {{LinkForElement}}.

This template can be evaluated using the {{#iferror}} parser function:

  • {{#iferror:{{val|XX}}|error|OK}}error

See also[uredi kodo]