Template:StoreVariables
This template is a simple helper template that stores its parameter input to variables. The variable names are prefixed with
, which can be adjusted via {{options}}.
sv_
It is mainly intended to be used in cargo and DPL queries.
Usage
{{ storeVariables | <variable name 1> = <variable value 1> | <variable name 2> = <variable value 2> | ... | <variable name n> = <variable value n> }}
There is another version of the template, {{storeVariables/sum}}
, which, if it receives the name of a variable for which there is already a value, adds the existing value of the variable to the newly passed value. Note that this means that manual resetting of variables will likely be required.
For DPL queries, the template {{storeVariables/dpl}}
should be used. Instead of regular variables, it sets {{#dplvar:}}
s.
Examples
Code | Result |
---|---|
{{storeVariables|damage=10|usetime=fast}} |
damage: 10, usetime: fast |
{{storeVariables|damage=10|usetime=fast}}
|
damage: 10, usetime: fast
damage: 20, usetime: fast damage: 30, usetime: |
{{storeVariables/sum|crit=0.4|knockback=strong}} |
crit: 1.1, knockback: weak |
{{#dpl:title=Terra Blade|include={item infobox¦storeVariables/dpl} }}
|
757 yes broadswords / projectile melee |
Options
This template supports options through {{options}} template. All valid options are listed below, see {{options}} for usage and other infomation.
See Template:storeVariables/initOptions for the initial options setting of this template.
Name | Alias | Initial Value | Value Mapping[1] | Note |
---|---|---|---|---|
prefix | sv_ | |||
fields | (empty) | |||
fields_sep | / |
- ↑ Values with mapping will be stored and loaded as mapped value. Other values without mapping will be stored and loaded as-is.