Help:Cargo

Extension:Cargo is an extension that allows for the storage and querying of data contained within templates. It provides a lightweight way to store and query the data contained within the calls to templates, such as infoboxes. Data is not shown to the user unless a query is used,.

A list of Cargo tables for this wiki can be found at Special:CargoTables.

This a quick start guide on how to add and use a table. Cargo tables may ONLY be declared in templates.

Declaring a table
should go in between the template's &lt;noinclude&gt; section.

Example:

Fields are declared by.

Commonly Used Field Types

 * - holds the name of a page in the wiki
 * - holds standard, non-wikitext text
 * - holds standard, non-wikitext text; intended for longer values
 * - holds an integer
 * - holds a date without time
 * - holds a Boolean value, whose value should be 1 or 0, or 'yes' or 'no'
 * - holds text that is meant to be parsed by the MediaWiki parser
 * - holds the name of an uploaded file or image in the wiki (similar to Page, but does not require specifying the "File:" namespace)

Any other type specified will simply be treated as type "String". For the full list of supported field types see Cargo/Storing_data.

Storing Data
should go in between the template's &lt;includeonly&gt; section.

Example:

Data is stored by. All field names should be the same as the fields declared by.

Creating the Table
No data is actually generated or modified when a template page containing a  call is saved. Instead, the data must be created or recreated in a separate process.

From the template page, select the tab action called either "Create data" or "Recreate data". Upon selecting this action, and hitting "OK" in the page that shows up a new Cargo will be created or an existing one will be replaced.

Adding New Fields to an Existing Cargo Table

 * 1) Add the field as usual to.
 * 2) Save the template.
 * 3) Select the tab action "Recreate data".
 * 4) Add the field value to.

The field MUST be declared and added to the Cargo table before assigning values to it.

Querying Data
For more details, see Cargo/Querying_data.