Help:Template format/userparam parameter

This help page provides information and examples about the  parameter and the respective   (  for SMW 3.0+) variable to  allowing to add user parameters to the query.

Usage
It is possible to add a (single) extra parameter to the query. To do this you add  to the query. In the template used to format the results of the query, the value given after  will be available as the value for the variable called   (  for SMW 3.0+). This allows for extra re-usability for the template. You can create a single template that can be called from different queries with different results, based on the parameter. Since, this feature not only apply to the  but also to the   and the  .CiteRef::gh:smw:217

brought even further improvements by introducing the parameters CiteRef::gh:smw:cbf79f5,  CiteRef::gh:smw:a832dc0 and  CiteRef::gh:smw:a832dc0 that make the respective information available to the template on which it was added via inheritance. SMW 3.0.0 renamed these parameters to,   and  .CiteRef::gh:smw:3130

Example 1 - default value via the variable
This example shows how you can set a default value for the  parameter by specifying it via the   variable in the respective template with  :


 * Result

The value "squeeze" was used in the output since this was specified as the default via template by adding  to it. There was no value specified in the query via  to override it.

Example 2 - individual value via the parameter
This example shows how you can set an individual value for the  parameter which will override the default value specified via the   variable in the respective template with  :


 * Result

The value "have their home" was used in the output since this was specified in the query via the  parameter to override the the default set via template which contains   (  in v3.0+).

Example 3 - inherit query conditions, limit and offset to the "outrotemplate"
The example "Demo:Examples/Queries/Template with tabular output and math functions" shows how to use,   and   parameter.