Help:DPL/manual/dplvar

From Guild Wars 2 Wiki
Jump to navigationJump to search

This is an auxiliary function module within the DPL package. It provides similar functionality to mw:Extension:Variables.

Variables can be set and then retrieved from an article page or from templates used in that article.

Usage[edit]

{{#dplvar:set|name1|value1|name2|value2|..|..}}

{{#dplvar:default|name|value}}

{{#dplvar:name}}

Parameters[edit]

The functionality of this function adapts depending on the first parameter.

1 (unnamed parameter)
The mode ("set", "default") or custom variable name.
If using "set" mode: subsequent parameters will become newly defined key-value variables.
If using "default" mode: subsequent parameters will be defaults for key-value variables. Note that earlier occurrences of "set" on a page will not be overridden by later occurrences of "default".
Any other option will be assumed to be a custom variable name that is being requested. If the variable has been defined, it will be displayed.

Example[edit]

{{#dplvar:set|a|x|b|y|c|z}}
{{#dplvar:default|a|aaaa}}
{{#dplvar:default|d|dddd}}
 a={{#dplvar:a}}
 b={{#dplvar:b}}
 c={{#dplvar:c}}
 d={{#dplvar:d}}
a=x
b=y
c=z
d=dddd