• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Ifor

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]

The Ifor template extends the #ifeq: parser function, allowing it to pass multiple case strings against the same number of comparison strings. It returns a true result if any single case string is equal to any single comparison string, returning a false result otherwise.

Usage

This template compares if any comparison string (up to 30 unnamed numeric parameters; test1, test2, test3, etc.) equals its matching case string (up to 30 unnamed numeric parameters; val1, val2, val3, etc.) then returns a single result string (parameter then) if any are equal or returns a single optional default result string (parameter else) if none are equal.

The test and val parameters ignore case sensitivity (treat lower- and upper-case as equal inputs) and also ignore pre-integer zeros (e.g., 02 is equal to 2, 002 is equal to 2).

Full blank syntax

{{ifor
| test1 = 
| val1  =
| test2 =
| val2  =
| test3 =
| val3  =
<!-- up to 30 test and var parameters can be inputted, using the same method as shown above -->
| then  = 
| else  = 
}}

See also

  • {{if empty}}
  • {{both}}
The above documentation is transcluded from Template:Ifor/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:Ifor&oldid=1304299170"
Last edited on 5 August 2025, at 05:25

Languages

    • تۆرکجه
    • বাংলা
    • Bahasa Indonesia
    • Slovenščina
    • کوردی
    • Српски / srpski
    • Sunda
    • Tiếng Việt
    • 粵語
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 5 August 2025, at 05:25 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop