Template:VarQuery

From Dota 2 Wiki
Jump to: navigation, search

Documentation for Template:VarQuery [ view | edit | purge ]

Lua logo.svg
▶️ Swapsies!
This template uses Lua.
Its code can be found under Module:VarQuery.


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="Axe"
}}

* {{#var:cargo_image}}
* {{#var:cargo_primary_attribute}}

  • File:Axe icon.png
  • Strength

TemplateData

No description.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Tablestables table

no description

Example
heroes
Stringrequired
Fieldsfields field

no description

Default
_pageName
Stringsuggested
Wherewhere

no description

Example
_pageName="Axe"
Stringsuggested
Join onjoin on

no description

Stringoptional
Group bygroup by

no description

Stringoptional
Havinghaving

no description

Stringoptional
Order byorder by

no description

Stringoptional
Limitlimit

A limit of 1 may be set. This will supress the error multiple results usually produce.

Numberoptional
Variable prefixprefix

no description

Default
cargo_
Stringoptional