Template:Setvar

From Guild Wars Wiki
Jump to navigationJump to search


Description[edit]

{{setvar|<name>|<value>}}

This is a workaround for using the Variables extension within conditional expressions.
With MediaWiki 1.12+, it is recommended that you use the normal syntax {{#vardefine:<name>|<value>}} instead.

Example[edit]

{{ #ifexpr: 1 + 1 = 2
| {{setvar|result|equal}}
| {{setvar|result|not equal}}
}}
<code>1 + 1</code> is ''{{#var:result}}'' to <code>2</code>.


1 + 1 is equal to 2.