Examples/Module: dplvar (example 1): Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
(Add example)
 
imported>FrozenPlum
m (Couple of wording changes)
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
it saves as a new section at the bottom of your '''User:Username/Sandbox'''
it saves as a new section at the bottom of your '''User:Username/Sandbox'''
-->
-->
==Example==
==Part 1==
Part one of this example sets the variable, names it "varName", and then assigns the value "My Value".
This sets a variable, names it "varName", and then assigns the value "My Value" to it.<br>
'''Note:''' The result '''is empty''' because setting a variable simply assigns a value, it doesn't also ''display'' that variable.
<pre>
<pre>
{{#dplvar:set|varName|My Value}}
{{#dplvar:set|varName|My Value}}
</pre>
</pre>


==Part 1 Result==
'''Note:''' The result will be empty, because setting the variable doesn't also ''display'' that variable.

==Result==
{{#dplvar:set|varName|My Value}}
{{#dplvar:set|varName|My Value}}

==Part 2==
This displays the (already set above) value of the variable called "varName".
<pre>
{{#dplvar:varName}}
</pre>

==Part 2 Result==
{{#dplvar:varName}}
<noinclude>
<noinclude>
[[Category:Uses dplvar module]]
[[Category:Uses dplvar module]]

Latest revision as of 03:00, 21 April 2023

Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

Part 1

This sets a variable, names it "varName", and then assigns the value "My Value" to it.
Note: The result is empty because setting a variable simply assigns a value, it doesn't also display that variable.

{{#dplvar:set|varName|My Value}}

Part 1 Result

{{#dplvar:set|varName|My Value}}

Part 2

This displays the (already set above) value of the variable called "varName".

{{#dplvar:varName}}

Part 2 Result

{{#dplvar:varName}}