Working with the sep "separator" parameter

From semantic-mediawiki.org
Jump to: navigation, search
Table formatWorking with the sep "separator" parameter
"separator" parameter to the table and broadtable format
This page describes the "seperator" parameter to the table and broadtable format.
Keywords
Table of Contents

Semantic MediaWiki 2.2.0 introduced the "sep" separator parameter for the table and broadtable result format. Thus one may use individual separators like "," or ";" etc. to distinguish between different resulting values within a table cell instead of "<code><br /></code>" which was imperatively used in previous versions of Semantic MediaWiki and is still used as the default separator.1

Example without a specified sep parameter (default)

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Has point of interest=Point of interest
 |mainlabel=City
 |sort=Has point of interest
 |headers=plain
}}

This produces the following output:

CityPoint of interest
BerlinBrandenburg Gate
Museumsinsel
Reichstag
MunichDom zu Unserer Lieben Frau
Schloss Nymphenburg

Example with a specified sep parameter

{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Has point of interest=Point of interest
 |mainlabel=City
 |sort=Has point of interest
 |headers=plain
 |sep=,&ensp;
}}

This produces the following output:

CityPoint of interest
BerlinBrandenburg Gate, Museumsinsel, Reichstag
MunichDom zu Unserer Lieben Frau, Schloss Nymphenburg

NoteNote:  Semantic MediaWiki automatically detects the last value shown and does not add the separator to it.