| This template uses Lua: |
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 appear permanently transcluded instead of {{Error}}.
Usage
[edit]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.}}←- ↳ → Foobar ←
→{{If then verbatim else error|| Foobar |Error: Lorem ipsum dolor sit amet.}}←- ↳ →Error: Lorem ipsum dolor sit amet.←
→{{If then verbatim else error| | Foobar |Error: Lorem ipsum dolor sit amet.}}←- ↳ →Error: Lorem ipsum dolor sit amet.←
→{{If then verbatim else error|| Foobar }}←- ↳ →Error: There is no text.←
→{{If then verbatim else error}}←- ↳ →Error: There is no text.←