Template:Drop/doc: Difference between revisions
(add name) |
(add arbitrary link support for things like boards/special weapons) |
||
Line 64: | Line 64: | ||
"description": { | "description": { | ||
"en-ca": "The name of the item. Not stored in Cargo. If omitted, the template will not render." | "en-ca": "The name of the item. Not stored in Cargo. If omitted, the template will not render." | ||
} | }, | ||
"example": { | |||
"en-ca": "Eternal Psychodrive/U+" | |||
}, | |||
"type": "string" | |||
}, | |||
"link": { | |||
"label": { | |||
"en-ca": "Link to Page" | |||
}, | |||
"description": { | |||
"en-ca": "The page of the item. Not stored in Cargo. Dependent on item name for rendering. If omitted, no link will be provided. " | |||
}, | |||
"example": { | |||
"en-ca": "Eternal Psychodrive/U+" | |||
}, | |||
"type": "wiki-page-name", | |||
"suggested": true | |||
} | } | ||
}, | }, | ||
"description": "Template used for displaying and/or storing items and their drop locations in Cargo. All parameters within are stored in Cargo unless otherwise stated." | "description": "Template used for displaying and/or storing items and their drop locations in Cargo. All parameters within are stored in Cargo unless otherwise stated.", | ||
"paramOrder": [ | |||
"source", | |||
"table label", | |||
"item id", | |||
"tickets", | |||
"name", | |||
"link" | |||
], | |||
"format": "block" | |||
} | } | ||
</templatedata> | </templatedata> | ||
Line 73: | Line 99: | ||
== Notes == | == Notes == | ||
* If used in a namespace, the store will fail with notice. | * If used in a namespace, the store will fail with notice. | ||
* If name is provided, the template will render a table row. | * If name is provided, the template will render a table row. It is intended to be used within a table, as it has no knowledge of sister templates. | ||
* If '''any''' arguments that would be passed to Cargo are invalid, the store will silently fail. | * If '''any''' arguments that would be passed to Cargo are invalid, the store will silently fail. | ||
** It is not known to me, at this time, if it is possible to make Cargo return an error if validation fails without duplicating the logic into the Drop template itself. As a stopgap, viewing page values will detail what fields are being sent to Cargo. | ** It is not known to me, at this time, if it is possible to make Cargo return an error if validation fails without duplicating the logic into the Drop template itself. As a stopgap, viewing page values will detail what fields are being sent to Cargo. | ||
* Additionally, if any stores are rejected on a page using this template, all subsequent stores (using this template?) on said page will automatically fail. | * Additionally, if any stores are rejected on a page using this template, all subsequent stores (using this template?) on said page will automatically fail. |
Revision as of 16:33, 6 July 2025
Template used for displaying and/or storing items and their drop locations in Cargo. All parameters within are stored in Cargo unless otherwise stated.
Parameter | Description | Type | Status | |
---|---|---|---|---|
source | source | no description | String | required |
table label | table label | no description
| String | required |
item id | item id | no description | String | required |
tickets | tickets | no description | Number | required |
name | name | no description | String | optional |
link | link | no description | Page name | suggested |
Notes
- If used in a namespace, the store will fail with notice.
- If name is provided, the template will render a table row. It is intended to be used within a table, as it has no knowledge of sister templates.
- If any arguments that would be passed to Cargo are invalid, the store will silently fail.
- It is not known to me, at this time, if it is possible to make Cargo return an error if validation fails without duplicating the logic into the Drop template itself. As a stopgap, viewing page values will detail what fields are being sent to Cargo.
- Additionally, if any stores are rejected on a page using this template, all subsequent stores (using this template?) on said page will automatically fail.