Template:If/doc

With this template the parser functions of Extension:ParserFunctions with names starting with  (those, apart from , with the functionality of a conditional expression) can be used in a way such that they do not strip spaces and newlines from the "then" and "else" part. For evaluating the condition spaces and newlines are stripped like with ParserFunctions.

Usage

 * 4 parameters:
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * 5 parameters:
 * gives ""
 * gives ""

Compare:
 * 3 parameters:
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * gives ""
 * 4 parameters:
 * gives ""

Note that, unlike parser functions, templates require writing equals signs in values of unnamed parameters as

For full substitution, simply use  or. If the condition contains a parser function, template, or variable, that should be substituted too. Optionally the "then" or "else" part can also be substituted.

Error messages (examples):


 * gives
 * gives

Technical

 * Auxiliary templates: If/errmsg, P1, P2, P3