Template:Guide table/doc: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Documentation subpage}} {{Lua|Module:Guide}} {{Documentation categories| <!-- Categories and interwikis go here. --> Category:Query templates Category:Guide templates Category:Table templates }}") |
No edit summary |
||
| Line 2: | Line 2: | ||
{{Lua|Module:Guide}} | {{Lua|Module:Guide}} | ||
This template performs a [[mw:Extension:Cargo/Querying data|Cargo query]] for [[guide]]s and returns the results as a formatted table. Guide pages must use {{tl|Guide}} in order to be queryable. | |||
==Parameters== | |||
===Query parameters=== | |||
These parameters are used to construct the Cargo query. For more information about how these parameters should be used, see [[mw:Extension:Cargo/Querying data|Extension:Cargo/Querying data]]. | |||
{| class="wikitable sortable" | |||
! Parameter | |||
! Value | |||
! Description | |||
! Required | |||
|- | |||
| where | |||
| str | |||
| The conditions that must be met for guides to appear in the table. This is the main portion of the WHERE clause in the query. | |||
| {{no}} | |||
|- | |||
| tables | |||
| list[str] | |||
| A comma-separated list of any additional Cargo tables to select from. This corresponds to the FROM clause in the query. | |||
| {{no}} | |||
|- | |||
| join | |||
| list[str] | |||
| Specifies how the rows are combined from any additional Cargo tables given by {{para|tables}}. This corresponds to JOIN clauses in the query. | |||
| {{no}} | |||
|- | |||
| orderBy | |||
| list[str] | |||
| Fields to sort the results by, and in which order. This corresponds to the ORDER BY clause in the query. Defaults to <code>guides._pageName ASC</code> to sort the guides by their page name in alphabetical order. | |||
| {{no}} | |||
|- | |||
| limit | |||
| int | |||
| The maximum number of rows to return. This corresponds to the LIMIT clause in the query. | |||
| {{no}} | |||
|- | |||
| groupBy | |||
| list[str] | |||
| Additional fields to group rows by, secondary to <code>guides._pageID</code>. This corresponds to the GROUP BY clause in the query. | |||
| {{no}} | |||
|- | |||
| having | |||
| list[str] | |||
| The conditions that must be met when grouping rows. This corresponds to the HAVING clause in the query. | |||
| {{no}} | |||
|} | |||
==Usage== | |||
Without specifying any query parameters, this template will display a list of all guides. | |||
<pre>{{Guide table}}</pre> | |||
{{Documentation categories| | {{Documentation categories| | ||
Revision as of 23:17, 3 July 2025
This subpage provides documentation for Template:Guide table.
This template performs a Cargo query for guides and returns the results as a formatted table. Guide pages must use {{Guide}} in order to be queryable.
Parameters
Query parameters
These parameters are used to construct the Cargo query. For more information about how these parameters should be used, see Extension:Cargo/Querying data.
| Parameter | Value | Description | Required |
|---|---|---|---|
| where | str | The conditions that must be met for guides to appear in the table. This is the main portion of the WHERE clause in the query. | |
| tables | list[str] | A comma-separated list of any additional Cargo tables to select from. This corresponds to the FROM clause in the query. | |
| join | list[str] | Specifies how the rows are combined from any additional Cargo tables given by |tables=. This corresponds to JOIN clauses in the query.
|
|
| orderBy | list[str] | Fields to sort the results by, and in which order. This corresponds to the ORDER BY clause in the query. Defaults to guides._pageName ASC to sort the guides by their page name in alphabetical order.
|
|
| limit | int | The maximum number of rows to return. This corresponds to the LIMIT clause in the query. | |
| groupBy | list[str] | Additional fields to group rows by, secondary to guides._pageID. This corresponds to the GROUP BY clause in the query.
|
|
| having | list[str] | The conditions that must be met when grouping rows. This corresponds to the HAVING clause in the query. |
Usage
Without specifying any query parameters, this template will display a list of all guides.
{{Guide table}}