Help:Plainlist format

From Linux Web Expert

Revision as of 12:20, 13 April 2020 by >Jaideraf (typo)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Plainlist format
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).
Further Information
Provided by: Semantic MediaWiki
Added: 3.0.0
Removed: still supported
Requirements: none
Format name: plainlist
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. yes
Authors: Stephan Gambke
Categories: misc
Keywords
list · template
Table of Contents

The result format plainlist is used to format query results as comma separated lists. It was introduced in Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki1 and is the default result format for all queries without additional printout statements. It replaces result format "Template"No description was provided. which is now deprecated. Similar formats are result format "List"Outputs results in a comma separated list, with additional outputs shown in parentheses. The output introduces class attributes to HTML elements to facilitate easy individual styling., result format "Ol"Outputs results as a numbered list, with additional outputs shown in parentheses. and result format "Ul"Outputs results as a bulleted list, with additional outputs shown in parentheses..

If the output should include class attributes to HTML elements then result format "List"Outputs results in a comma separated list, with additional outputs shown in parentheses. The output introduces class attributes to HTML elements to facilitate easy individual styling. needs to be used.

See also the /migration guide/ if you are upgrading from versions prior to Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki.

Parameters

General
⧼validator-describe-header-parameter⧽ ⧼validator-describe-header-type⧽ ⧼validator-describe-header-default⧽ ⧼validator-describe-header-description⧽
source ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ Alternative query source
limit ⧼validator-type-integer⧽ 50 The maximum number of results to return
offset ⧼validator-type-integer⧽ 0 The offset of the first result
link ⧼validator-type-string⧽ all Show values as links
sort ⧼validator-type-string-list⧽ ⧼validator-describe-empty⧽ Property to sort the query by
order ⧼validator-type-string-list⧽ ⧼validator-describe-empty⧽ Order of the query sort
headers ⧼validator-type-string⧽ show Display the headers/property names
mainlabel ⧼validator-type-string⧽ no The label to give to the main page name
intro ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The text to display before the query results, if there are any
outro ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The text to display after the query results, if there are any
searchlabel ⧼validator-type-string⧽ ... further results Text for continuing the search
default ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The text to display if there are no query results
import-annotation ⧼validator-type-boolean⧽ no Additional annotated data are to be copied during the parsing of a subject
Format specific
⧼validator-describe-header-parameter⧽ ⧼validator-describe-header-aliases⧽ ⧼validator-describe-header-type⧽ ⧼validator-describe-header-default⧽ ⧼validator-describe-header-description⧽
propsep - ⧼validator-type-string⧽ , The separator between the properties of a result entry
valuesep - ⧼validator-type-string⧽ , The separator between the values for a property of a result
template - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The name of a template with which to display the printouts
named args namedargs ⧼validator-type-boolean⧽ no Name the arguments passed to the template
userparam - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ A value passed into each template call, if a template is used
class - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ An additional CSS class to set for the list
introtemplate - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The name of a template to display before the query results, if there are any
outrotemplate - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The name of a template to display after the query results, if there are any
sep - ⧼validator-type-string⧽ , The separator between results
prefix - ⧼validator-type-string⧽ none Control display of namespace in printouts
Detailed documentation and examples


Most parameters can be combined to create the desired display of the output to a query.
Detailed documentation and examples for the template parameters

Moreover the template parameters (template, introtemplate and outrotemplate) allow for using variables in the templates used to display the output of the query:


All variables can be combined to create the desired display of the output to a query when using a template.

Examples

Standard output

Query
{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
}}
Result


Extended output

If more printouts are requested, then the format must be requested explicitly. Otherwise result format "Table"Outputs the results in a table (default for queries with printout statements). would be used.

Syntax
{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population
 |?Area#km²=Area
 |format=plainlist
}}
Result


Hidden headers

The headers can be hidden by giving them empty labels:

Syntax
{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population=
 |?Area#km²= 
 |format=plainlist
}}
Result


The same effect is achieved by using headers=hide:

Syntax
{{#ask:
 [[Category:City]]
 [[Located in::Germany]] 
 |?Population
 |?Area#km²
 |format=plainlist
 |headers=hide
}}
Result


Tips

See also

#scite could not render a citation text for reference "gh:smw:2488" because type "issue" was not assigned to a template.
#scite could not render a citation text for reference "gh:smw:3130" because type "pullrequest" was not assigned to a template.

Template:Interlanguagelink: en

References

  1. ^ gh:smw:2488