Status: | effective |
Progress: | 100% |
Version: | 3.2.0+ |
Help:Plainlist format – parameter named args
Parameter named args Property "Has name" (as page type) with input value "Parameter named args" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.
| |
---|---|
This help page explains the usage of named arguments when using a template to display the output of the query. | |
Keywords | |
This help page explains the usage of named arguments when using templates to display the output of your queries. Since Semantic MediaWiki 3.2.0Released on an unknown date unknown versions of MediaWiki you may also use namedargs
as the name of the parameter.1
The default value to this parameter is "no
" meaning that the arguments for templates are unnamed arguments (also known as anonymous or numerical arguments). Named arguments can be enabled with "yes
".
Named arguments via the named args
parameter are used to make the connection between the printout statement and the respective template argument easier to comprehend. They are used for convenience and increased wikitext transparency.
Example
- Syntax
{{#ask: [[Category:City]] [[Located in::Germany]] |?=city |?Population=population |?Area=area |format=plainlist |introtemplate=TableNamedArgsHeader |template=TableNamedArgsBody |outrotemplate=TableFooter |named args=yes }}
- Result
The templates used to create this example: TableNamedArgsHeader, TableNamedArgsBody and TableFooter.
- Notes
- The argument names are case-sensitive.
- The "labels" to the printout statements specify the argument names used.
- To add an argument name to the resulting page you have to use
|?=somename
. To get a plain output (not linked) additionally use|link=none
. - The named argument is added to the template like, e.g.
{{{somename}}}
. Prior to Semantic MediaWiki 3.0.0Released on an unknown date unknown versions of MediaWiki like, e.g.{{{?somename}}}
. - To hide the named argument if the result does not have a value for the respective printout statement use, e.g.
{{{somename|}}}
. - To fill the named argument if the result does not have a value for the respective printout statement use, e.g.
{{{somename|sometext}}}
. - If clicking on the "further results" yields an empty query because the
named args
parameter is not reproduced here, you may have to remove thesearchlabel
parameter.
See also
- Help page on generating the same result using unnamed arguments
References
- ^ gh:smw:4655