Difference between revisions of "Template:SetMultipleValues"
Jump to navigation
Jump to search
(7 intermediate revisions by the same user not shown) | |||
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. | + | * <code><nowiki>|excludeself=</nowiki></code> - if ''yes'', then if the object (i.e. <code><nowiki>{{FULLPAGENAME}}</nowiki></code>) is found among the values, it is not stored. Default value is empty. |
</noinclude><includeonly><!-- | </noinclude><includeonly><!-- | ||
Line 14: | Line 14: | ||
-->{{#arrayunique:valuesArray}}<!-- | -->{{#arrayunique:valuesArray}}<!-- | ||
-->{{#arrayprint:valuesArray||@@@@|<!-- | -->{{#arrayprint:valuesArray||@@@@|<!-- | ||
− | -->{{#ifexpr: {{{excludeself|}}} and | + | -->{{#ifexpr: {{#ifeq: {{{excludeself|}}}|yes|1|0}} and {{#ifeq: @@@@|{{FULLPAGENAME}}|1|0}}||{{#set:{{{property|}}}=@@@@}} }}<!-- |
-->|}}<!-- | -->|}}<!-- | ||
-->}}</includeonly> | -->}}</includeonly> |
Latest revision as of 21:17, 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 the object (i.e.{{FULLPAGENAME}}
) is found among the values, it is not stored. Default value is empty.