Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:If then verbatim else error

From Wikipedia, the free encyclopedia
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

Template documentation[view] [edit] [history] [purge]
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}}.

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.

See also

[edit]
The abovedocumentation istranscluded fromTemplate:If then verbatim else error/doc.(edit |history)
Editors can experiment in this template's sandbox(create |mirror) and testcases(create) pages.
Add categories to the/doc subpage.Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:If_then_verbatim_else_error&oldid=1326531197"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp