This template performs a Cargo query and stores its results into variables that can be used later on. The query must not yield more than one result.
Usage
The argument names are identical to the #cargo_query
arguments. The following are available:
{{VarQuery | tables = | fields = | where = | join on = | group by = | having = | order by = }}
- Note:
|table=
and|field=
may be used instead of|tables=
and|fields=
.|fields=
defaults to_pageName
The values get stored into variables. The variable names are the field names prefixed with cargo_
.
Example
{{VarQuery | tables = heroes | fields = image, primary_attribute | where = _pageName="斧王" }} * {{#var:cargo_image}} * {{#var:cargo_primary_attribute}}
- File:Axe icon.png
- Strength
TemplateData
无描述。
参数 | 说明 | 类型 | 状态 | |
---|---|---|---|---|
Tables | tables table | 无描述
| 字符串 | 必填 |
Fields | fields field | 无描述
| 字符串 | 推荐 |
Where | where | 无描述
| 字符串 | 推荐 |
Join on | join on | 无描述 | 字符串 | 可选 |
Group by | group by | 无描述 | 字符串 | 可选 |
Having | having | 无描述 | 字符串 | 可选 |
Order by | order by | 无描述 | 字符串 | 可选 |
Limit | limit | A limit of 1 may be set. This will supress the error multiple results usually produce. | 数值 | 可选 |
Variable prefix | prefix | 无描述
| 字符串 | 可选 |