Difference between revisions of "Template:FormattingError/doc"
(Created page with "'''{{tl|FormattingError}}''' is a utility template designed to be called from other templates. == Example == <pre> {{#ifeq:{{NAMESPACE}}|{{ns:...") |
m |
||
Line 12: | Line 12: | ||
== Usage == | == Usage == | ||
The first parameter passed to the template replaces the generic "Formatting error!" message. | The first parameter passed to the template replaces the generic "Formatting error!" message. | ||
+ | |||
+ | <noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude> |
Latest revision as of 18:22, 17 May 2021
{{FormattingError}} is a utility template designed to be called from other templates.
Example
{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{FormattingError|Template:xt is only for examples of style and formatting. Do not use it in actual articles.}}
The above code, which is used in the {{xt}} template, raises an error if the template is used in the main article namespace. In other words, if the NAMESPACE's unique numeric code equals 0, produce the given error message.
Because {{xt}} is not to be used in article content, this code allows the template to notify an editor who attempts to do so, instead of displaying the template's contents. This isn't the only way this template can be used, but is a good example of an appropriate use.
Usage
The first parameter passed to the template replaces the generic "Formatting error!" message.