Difference between revisions of "Template:SetMultipleValues"
Jump to navigation
Jump to search
(Created page with "<noinclude> This template is called to set an array of values at the same time. '''NOTE:''' As any "set" template, it doesn't print anything on the page, but merely sets the...") |
|||
Line 7: | Line 7: | ||
* <code><nowiki>|values=</nowiki></code> - a comma delimited array of values to store. | * <code><nowiki>|values=</nowiki></code> - a comma delimited array of values to store. | ||
* <code><nowiki>|property=</nowiki></code> - the name of the property that each of the values will be set under. | * <code><nowiki>|property=</nowiki></code> - the name of the property that each of the values will be set under. | ||
+ | * <code><nowiki>|excludeself=</nowiki></code> - if ''yes'', then if {{FULLPAGENAME}} is found among the values, it is not stored. Default value is empty. | ||
</noinclude><includeonly><!-- | </noinclude><includeonly><!-- | ||
Line 12: | Line 13: | ||
-->|{{#arraydefine:valuesArray|{{{values|}}} }}<!-- | -->|{{#arraydefine:valuesArray|{{{values|}}} }}<!-- | ||
-->{{#arrayunique:valuesArray}}<!-- | -->{{#arrayunique:valuesArray}}<!-- | ||
− | -->{{#arrayprint:valuesArray||@@@@|{{#set:{{{property|}}}=@@@@}}|}}<!-- | + | -->{{#arrayprint:valuesArray||@@@@|<!-- |
+ | -->{{#ifexpr: {{{excludeself|}}} and (@@@@ = {{FULLPAGENAME}})}}||{{#set:{{{property|}}}=@@@@}} }}<!-- | ||
+ | -->|}}<!-- | ||
-->}}</includeonly> | -->}}</includeonly> |
Revision as of 20:44, 20 May 2017
This template is called to set an array of values at the same time.
NOTE: As any "set" template, it doesn't print anything on the page, but merely sets the appropriate values.
Parameters:
|values=
- a comma delimited array of values to store.|property=
- the name of the property that each of the values will be set under.|excludeself=
- if yes, then if Template:SetMultipleValues is found among the values, it is not stored. Default value is empty.