Teimpléad:If then show/doc
From Wikipedia, the free encyclopedia
This template tests whether the first unnamed parameter is not an empty string and returns it if it is not empty. Otherwise it returns the second unnamed parameter.
This is a documentation subpage for Teimpléad:If then show. It contains usage information, categories, interlanguage links and other content that is not part of the original teimpléad page. |
This is useful when the first parameter is a {{#invoke: }} of a Lua module that may return a value or nothing. Because it uses the {{#invoke: }} just once, it simplifies the coding of infoboxes, for example.
The optional third and fourth unnamed parameters provide a prefix and a suffix for the first parameter when returned. This enables the designer to construct more complex templates that still only use one invoke of a Lua module.