Help:Setting values using #set with the "separator" parameter – examples

From semantic-mediawiki.org
"separator" parameter to #set
This page provides examples on how to use the "separator" parameter to the "#set" parser function.
Keywords
Table of Contents

Semantic MediaWiki 1.9.0Released on 3 January 2014 and compatible with MW 1.19.0 - 1.22.x. introduced the |+sep=... parameter to the #set parser function. This page shows examples for using many different separators allowing to split annotations.

Example[edit]

Syntax
{{#set:
 |Has set test 1=Value 1;Value 2;Value 3;Value 4|+sep=;
 |Has set test 2=Another value
 |Has set test 3=12+22+3+4+5+6+7+8+9+10|+sep=+
 |Has set test 4=In between value
 |Has set test 5=123,1234,12345,|+sep=
 |Has set test 6=One,or,two,more,values|+sep
 |Has set test 7=Last value
}}
Result

For details and verification, see the property assignments to the different "Has set test_x" properties on special page Special:Browse for this page.

The possibility of using pipes "|" for setting multiple values like e.g. "{{#set: Has set test 8=Pipe1|Pipe2|Pipe3 }}" was deprecated starting with Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. and will be removed in a later version. It is strongly recommended to migrate to using the "|+sep" parameter.1

Documentation[edit]

See also this page for more documentation on using separators with the #set parser function.

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:1345