Template talk:If

Addition of pp-template
Based on User:Wknight94 protection, suggest adding pp-template to the top of the template page Tamr007 (talk) 10:09, 10 July 2008 (UTC)


 * [[Image:Yes check.svg|20px]] Y Done using the unprotected documentation subpage. { { Nihiltres | talk|log } } 13:43, 10 July 2008 (UTC)

Confused...
Could anyone explain me the usage of this template in the form of:

if condition then statement1 else statement2

I noticed that the documentation was somewhat unclear. Alexius08 is welcome to talk about his contributions. 14:13, 1 October 2008 (UTC)
 * I also came here looking for this.  Blue Rasberry    (talk)   14:16, 11 November 2011 (UTC)


 * There are several parser functions for this, depending on the kind of condition, see mw:Help:Extension:ParserFunctions. This Template:If is a special version preserving newlines and spaces.--Patrick (talk) 11:39, 27 December 2011 (UTC)


 * I can probably work out the syntax from that link, but this section
 * gives " p ". Notice the pair of vertical bars surrounding the empty first parameter.
 * gives " p "
 * gives " p "
 * gives " p "
 * gives " p "
 * Compare:
 * gives "p"
 * gives "p"
 * gives "p"
 * gives "p"
 * gives "p"
 * Is still entirely opaque and unhelpful and needs someone with knowledge of the syntax to write in clear English what each expression is testing for and how the products are being produced. The spacing issues are entirely secondary to why most of us will be coming by here. — Llywelyn II   09:36, 22 February 2014 (UTC)

If in multiple comparisons
Does anyone know how to use #if: when I want to check against multiple statements? Example: Say i want to check e.g. whether 1 OR 2 is not an empty value in an infobox, how to accomplish that? The example i have does not work. There appaerently is a problem with multiple conditions? Or do i miss something? Regards, DTBone (talk) 18:18, 11 October 2008 (UTC)


 * The parser function does not check params, you can use both together e.g and if any of them have values it will be true, so e.g if a=a and b=b it would be "ab", thus returns true; there is no way to tell which param returns true though in the 1 function though, this should work for most of those cases though:
 * - this will display both if true.
 * - this will display a if true, but if a returns false it displays b (if true)
 * - basically the same as above, just looks lamer.
 * you can also nest a parser function in another:
 * r0x timing of de response imo -- 120.17.76.106 (talk) 11:21, 24 January 2009 (UTC)
 * r0x timing of de response imo -- 120.17.76.106 (talk) 11:21, 24 January 2009 (UTC)