Difference between revisions of "DPL:Manual - dplvar"

From FollowTheScore
Jump to: navigation, search
(New page: {{Type Manual|section=dplvar}} === Syntax === <pre><nowiki> (1) {{#dplvar:set |name1|value1|name2|value2|..|..}} (2) {{#dplvar:default|name|value}} (3) {{#dplvar: name}} </n...)
 
 
Line 28: Line 28:
 
  d={{#dplvar:d}}
 
  d={{#dplvar:d}}
 
</nowiki></pre>
 
</nowiki></pre>
 
+
{{#dplvar:set|a|x|b|y|c|z}} {{#dplvar:default|a|aaaa}} {{#dplvar:default|d|dddd}}
{{#dplvar:set|a|x|b|y|c|z}}
 
{{#dplvar:default|a|aaaa}}
 
{{#dplvar:default|d|dddd}}
 
 
  a={{#dplvar:a}}
 
  a={{#dplvar:a}}
 
  b={{#dplvar:b}}
 
  b={{#dplvar:b}}

Latest revision as of 13:15, 4 October 2009

Manual dplvar

Syntax

 (1) {{#dplvar:set    |name1|value1|name2|value2|..|..}}
 (2) {{#dplvar:default|name|value}}
 (3) {{#dplvar:        name}}

Effect

(1) assigns the values to symbolic variable names.
(2) assigns the value only if the variable is empty / has not been used so far.
(3) returns the current value of the variable.

The variables can be set and retrieved from an article page or from templates used in that article.

Example

{{#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