Template:If then verbatim else error
Tools
Actions
General
Print/export
In other projects
| Thistemplate is being discussed in accordance with Wikipedia'sdeletion policy. Help reach a consensus atits entry. |
%5B%5BWikipedia%3ATemplates+for+discussion%2FLog%2F2025+December+9%23Template%3AIf+then+verbatim+else+error%5D%5D
| This template usesLua: |
The templates{{Error if empty}}, and{{If then verbatim else error}} are used to avoid unwanted transclusions of the{{Error}} template in the cases in which the {{#if}} (or a similar) parser function is not directly used for determining the error conditions. In these cases, these templates will appearpermanently transcluded instead of{{Error}}.
This template checks whether the first parameter is empty. If it is, it redirects all other parameters, shifted, to{{Error}}. If it is not, it displays the second parameter, preserving trailing and leading spaces.
→{{If then verbatim else error|Hello world| Foobar|Error: Lorem ipsum dolor sit amet.}}←→{{If then verbatim else error|| Foobar|Error: Lorem ipsum dolor sit amet.}}←→{{If then verbatim else error|| Foobar|Error: Lorem ipsum dolor sit amet.}}←→{{If then verbatim else error|| Foobar}}←→{{If then verbatim else error}}←