Template:Export cargo table/doc
This template is used to generate the code for storing all the data of a cargo table (or certain parts of it) to another wiki, e.g. a language variant of the Terraria Wiki.
Usage
{{ export cargo table | _table = <cargo table name> | _fields = <cargo table fields> | _limit = <maximum rows> | _delimiter = <row separator> | _withdeclare = y/yes | <field parameters> }}
- _table
Name of the table to export. See Special:CargoTables for a list of available cargo tables.
- _fields
List of the table's fields that should be included in the export, comma-separated. Note that due to Lua's implementation of cargo queries, the order of rows may vary depending on the specified fields, which causes different rows to be displayed if
is set. (However, it is guaranteed that all rows are displayed if $_limit
is set to $_limit
, even if their order might vary.)
-1
- _limit
Maximum number of rows that should be included in the export. Set this to
to include all rows. If omitted, defaults to the standard cargo query limit (generally 100).
-1
- _delimiter
String that separates the rows in the output. Defaults to a linebreak (<br/>
).
- _withdeclare
This parameter enables generation of the code for the declaration of the cargo table ({{#cargo_declare:}}
). For that, it needs the information about the fields and their types, which should be passed as the remaining parameters. These can easily be copied from the table's declaration code.
Examples
The table used in the following example is the Items table, declared by Template:Item infobox.
Code | Result |
---|---|
<div style="font-family: monospace;"> {{export cargo table | _table = Items | _fields = internalname, name, bodyslot, hardmode | _limit = 5 | _withdeclare = y | internalname = String | name = String | bodyslot = String | hardmode = Boolean }} </div> |
{{#cargo_declare:_table=Items|internalname=String|name=String|bodyslot=String|hardmode=Boolean}} |