Template:Ifnoteq then show: Difference between revisions
Jump to navigation
Jump to search
m (Protected "Template:Ifnoteq then show": High-risk template or module (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))) |
Richardpruen (talk | contribs) m (1 revision imported) |
(No difference)
|
Latest revision as of 16:43, 5 December 2021
This template tests whether the first unnamed parameter is equal to the second unnamed parameter and returns the third unnamed parameter if it does. Otherwise it returns the first unnamed parameter.
This is useful when the first parameter is a {{#invoke: }} of a Lua module that returns a value for which a specific exception is required. Because it uses the {{#invoke: }} just once, it simplifies the coding of infoboxes, for example.
Usage
An infobox field may return the (P17) for an article about a city. We may wish to use the abbreviation "USA" in place of "United States".