Dplvar
Page Template:Purgenote/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
|
Manual | dplvar |
Syntax
Sets one symbolic variable name and assign a value:
{{#dplvar:set|varname|valueofvar}}
Sets multiple symbolic variable names and assigns values to them (one after the other):
{{#dplvar:set|name1|value1|name2|value2|..|..}}
Assigns a value only if the variable is empty / has not been used so far:
{{#dplvar:default|name|value}}
Returns the current value of the variable:
{{#dplvar:name}}
Example
{{#dplvar:set|a|x|b|y|c|<!--empty-->}} {{#dplvar:default|a|aaaa}} {{#dplvar:default|c|cccc}} {{#dplvar:default|d|dddd}}
{{#dplvar:set|a|x|b|y|c|}} {{#dplvar:default|a|aaaa}} {{#dplvar:default|c|cccc}} {{#dplvar:default|d|dddd}} Result:
- a={{#dplvar:a}}
- b={{#dplvar:b}}
- c={{#dplvar:c}}
- d={{#dplvar:d}}
Notes:
- Variable "c" was set to "cccc" because it was set but with an empty note (empty value).
- Variable "d" was set to "dddd" because it was not already set.