Editing Help:Magic words

Jump to: navigation, search

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===
: ''Some parameters are optional. For documentation, see [[mw:Help:Extension:ParserFunctions]]. For #switch specifically, see [[Wikipedia:Help:Switch parser function]].
+
{{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 [https://meta.wikimedia.org/wiki/Help:Calculation m:Help:Calculation]).
+
  | 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>{{{1{{pipe}}}}}</code>, <code>{{{2{{pipe}}}}}</code>, etc., rather than <code>{{{1}}}</code>, <code>{{{2}}}</code>, etc.).
+
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 [[Wikipedia:Help:Conditional expressions]] and [[Wikipedia:Help:Switch parser function]].
+
* For examples and further explanations, see [[Help:Conditional expressions]] and [[Help:Switch parser function]].
  
 
===Other===
 
===Other===

Please note that all contributions to Gunsopedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Gunsopedia:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox