Difference between revisions of "Template:Vardefine/doc"

From Dragalia Lost Wiki
Jump to navigation Jump to search
>Eave
(Created page with "{{doc/start}} Internal logic lives at Module:Vardefine. This template takes a variable amount of named parameters, and assigns each parameter's value to a mw:Extension:V...")
>Eave
m (adding a warning about value overrides)
 
Line 15: Line 15:
  
 
In general, this is mostly intended to be used in conjunction with [[mw:Extension:Cargo|Cargo]] queries, when one would like to extract multiple values from a single query, instead of extracting single values over multiple queries.
 
In general, this is mostly intended to be used in conjunction with [[mw:Extension:Cargo|Cargo]] queries, when one would like to extract multiple values from a single query, instead of extracting single values over multiple queries.
 +
 +
'''Warning''': like all <code>{{#vardefine}}</code> calls, if you attempt to assign an identical field name a second time on the same page, it will overwrite the initial value.
 
{{doc/end}}
 
{{doc/end}}

Latest revision as of 04:46, 12 April 2020

50px Documentation

Internal logic lives at Module:Vardefine. This template takes a variable amount of named parameters, and assigns each parameter's value to a #vardefine'd variable using its name.

For example, the following are equivalent:

{{vardefine|ElementalType=Wind|Rarity=5|Portrait=File:210116 01 portrait.png|SkillName=Cyclone Kick}}
{{#vardefine:ElementalType|Wind}}
{{#vardefine:Rarity|5}}
{{#vardefine:Portrait|File:210116 01 portrait.png}}
{{#vardefine:SkillName|Cyclone Kick}}

In general, this is mostly intended to be used in conjunction with Cargo queries, when one would like to extract multiple values from a single query, instead of extracting single values over multiple queries.

Warning: like all {{#vardefine}} calls, if you attempt to assign an identical field name a second time on the same page, it will overwrite the initial value.