Editing Help:Magic words
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 292: | Line 292: | ||
===Conditional=== | ===Conditional=== | ||
− | + | {{hatnote|Some parameters are optional. For documentation, see [[mw:Help:Extension:ParserFunctions]]. For #switch specifically, see [[Help:Switch parser function]].}} | |
− | + | ||
{| class="wikitable" | {| class="wikitable" | ||
! Code | ! Code | ||
Line 299: | Line 298: | ||
|- | |- | ||
|<code> {{((}}#expr:''expression''{{))}} </code> | |<code> {{((}}#expr:''expression''{{))}} </code> | ||
− | | Evaluates ''expression'' (see [ | + | | Evaluates ''expression'' (see [[m:Help:Calculation]]). |
|- | |- | ||
| <code> {{((}}#if:''string'' {{pipe}}''result1'' {{pipe}}''result2''{{))}} </code> | | <code> {{((}}#if:''string'' {{pipe}}''result1'' {{pipe}}''result2''{{))}} </code> | ||
− | | Outputs ''result2'' if ''string'' is empty, otherwise outputs ''result1''. | + | | Outputs ''result2'' if ''string'' is [[Empty string|empty]], otherwise outputs ''result1''. |
|- | |- | ||
| <code> {{((}}#ifeq:''string1''{{pipe}}''string2'' {{pipe}}''result1'' {{pipe}}''result2''{{))}} </code> | | <code> {{((}}#ifeq:''string1''{{pipe}}''string2'' {{pipe}}''result1'' {{pipe}}''result2''{{))}} </code> | ||
Line 320: | Line 319: | ||
|} | |} | ||
− | If, in these conditional functions, empty unnamed parameters are to be parsed as empty rather than as text (i.e. as empty rather than as the text "{{{1}}}", "{{{2}}}", etc.), they will require trailing pipes (i.e. <code>{{ | + | If, in these conditional functions, [[Empty string|empty]] unnamed parameters are to be parsed as empty rather than as text (i.e. as empty rather than as the text "{{{1}}}", "{{{2}}}", etc.), they will require trailing pipes (i.e. <code>{{(((}}1{{pipe}}{{)))}}</code>, <code>{{(((}}2{{pipe}}{{)))}}</code>, etc., rather than <code>{{(((}}1{{)))}}</code>, <code>{{(((}}2{{)))}}</code>, etc.). |
* For the use of these functions in tables, see [[Wikipedia:Conditional tables]]. | * For the use of these functions in tables, see [[Wikipedia:Conditional tables]]. | ||
− | * For examples and further explanations, see [[ | + | * For examples and further explanations, see [[Help:Conditional expressions]] and [[Help:Switch parser function]]. |
===Other=== | ===Other=== |