960
edits
m (Search whole keys) |
(Fill the usage text) |
||
Line 6: | Line 6: | ||
}} | }} | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
This template returns the value mapped to a key, given a list of keys and their associated values. | |||
=Usage= | |||
<nowiki>{{</nowiki>Map|''keys''=<list_of_keys>|''values''=<list_of_values>|''key''=<key><nowiki>}}</nowiki> | |||
* ''keys'' is a list of keywords separated by the # symbol. | |||
* ''values'' is a list of values separated by the # symbol. | |||
* ''key'' is the element that will be used to find its associated value. | |||
The ''keys'' and ''values'' lists must have the same number of elements. In case the given ''key'' isn't found in the ''keys'' list, an empty string is returned. | |||
=Examples= | |||
* <nowiki>{{</nowiki>Map|''keys''=a#b#c|''values''=First value#Second value#Third value|''key''=b<nowiki>}}</nowiki><br>Will make the selection on this map:<br>a = First value<br>b = Second value<br>c = Third value<br>And will show: Second value<br> | |||
</noinclude> | </noinclude> |
edits