Changes

Jump to: navigation, search

Dungeons and Dragons Wiki:Programming Templates

137 bytes removed, 11:37, 2 March 2013
m
ArrayMap
== ArrayMap ==
<pre><nowiki>{{#arraymap: {{{varName|}}}|input separating token|stringName|Display for each string|output separating token}}</nowiki></pre>
Example: <pre><nowiki>{{#arraymap: {{{desc}}}|, |x|[[Descriptor::x]]}}</nowiki></pre>
In the example, an array map is created for the variable "desc" with each string in the array separated by ", " in the template usage page. The variable to reference each string is called "x" in this array. For each string, it gives it the Descriptor SMW property.
The By default, the output separating token can be modified or hidden. Doing so, you pass it a fifth parameter. It can be empty if you want no is the same as the input separating token at all. More information This can be seen at [http://stackoverflow.com/questions/7606131/arraymap-not-include-delimiter-in-output/7690275#7690275 Stack Overflow]changed, as per the next example.
Example: <pre><nowiki>{{#arraymap: Item 1, Item 2|,|x|x|:}}</nowiki></pre>
emailconfirmed, Administrators
8,864
edits

Navigation menu