Status: | effective |
Progress: | 100% |
Version: | 3.0.0+ |
Help:Plainlist format – variable #resultoffset
Variable #resultoffset
| |
---|---|
This help page explains how to add the resultoffset to a template. | |
Keywords | |
This help page explains the usage of the #resultoffset
variable when using templates with result format "Plainlist"Outputs results in a comma separated list, with additional outputs shown in parentheses. The output does not provide class attributes to HTML elements (default for queries without printout statements). to display the output of your queries. It was introduced with Semantic MediaWiki 1.9.2Released on 18 April 2014 and compatible with MW 1.19.0 - 1.22.x..1
The content to be added to the query on the template as the #resultoffset
variable equals the query offset defined with the offset
parameter for the query specifying the template.
Note that the #resultoffset
variable can only be used in conjunction with the #querycondition
variable.
Example[edit]
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] [[Area::+]] [[Population::+]] |?Population |?Area |format=plainlist |introtemplate=TableUnnamedArgsHeader |template=TableUnnamedArgsBody |outrotemplate=TableUnnamedArgsConditionOffsetFooter |offset=1 |searchlabel= }}
- Result
City | Population | Area |
---|---|---|
Cologne | 1,080,394 | 405.02 km²156.38 sqmi <br /> |
Frankfurt | 679,664 | 248.31 km²95.87 sqmi <br /> |
Munich | 1,353,186 | 310.43 km²119.86 sqmi <br /> |
Stuttgart | 606,588 | 207.35 km²80.06 sqmi <br /> |
Würzburg | 126,635 | 87.63 km²33.83 sqmi <br /> |
Average | 769,293 | 251.75 km² |
Total | 3,846,467 | 1,258.74 km² |
The templates used to create this example: TableUnnamedArgsHeader, TableUnnamedArgsBody and TableUnnamedArgsConditionOffsetFooter.
- Note
- The variable is added to the template with
{{{#resultoffset}}}
. Prior to Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. like, e.g.{{{smw-resultqueryoffset}}}
. - The query offset in the above example is:
1
. - Consider disabling the link to possible further results with the
searchlabel
parameter since showing them may not be intended
See also[edit]
- Help page on using templates
- Overview of available parameters
- Overview of available variables
References
- ^
- GitHub commit gh:smw:a832dc0