Template:Case
| Rules, info, and guidelines |
|---|
| Releases • Vehicles • Series • Cases Photos |
| Development notes |
| Foundation • Configuration |
This template sets and displays the contents of one Mattel case assortment. Usage is covered as part of the larger cases tutorial.
Documentation
Components
- {{Case/setFormat}} - Sets output variables based on format (i.e. for multipacks)
- {{Case/storeContent}} - Store logic, looped for each content.
- {{Case/printContent}} - HTML output template.
Case_Contents queried within: {{case}}, {{getCaseStats}}, {{current case}}
Info
In addition to some basic identification parameters, it takes a numbered list of every car in the case. Each item is then matched to its corresponding database entry, from which it retrieves the links and photo. Optional {{case item}} will append modifier "keys" e.g. __V2 to then be chopped off, stored, and passed to the query.
See MediaWiki:Gadget-Cases.css and MediaWiki:Common.js for style and script, respectively. The sorting options correlate as follows:
| Option | HTML attribute | Column printout |
|---|---|---|
| Default | data-sort-value
|
N/A (calculated during loop) |
| Name | title
|
Sort_Name
|
| Item # | id
|
Toy_Sortkey & Toy_Number
|
Cargo data
There is to no longer be a "Cases" table; Instead, the Case_Contents table will store its info (Letter, Month, etc.) alongside every content. Utility of the former can all be achieved through use of group by with the latter.
If ever needed, a list of all unique cases could be generated using:
{{#cargo_query:_table=Case_Contents
|fields=Case_Code,Year,Month<!-- etc.-->
|group by=Case_Code<!-- column not live yet -->
}}
(Current) Case_Contents fields:
| Column name | Field type | Description |
|---|---|---|
| Asst | String
|
5-digit product number |
| Namestring | wikitext
|
Individual content name, with any modifiers clipped off. Typically its own product number or in certain cases a placeholder string. This and "Year" are what {{getCaseStats}} will match to the Releases table. |
| ListID | Integer
|
Default # of content (i.e. current loop). Used for sorting and as group by parameter.
|
| Card_OR | Integer
|
Clipped modifier keys representing the cardback choice and per-item "vehicle count", as set by {{case item}}. "OR" stands for override; Signals the output to deviate from whatever the default card slot is. |
| Count_OR |
Current limitations
- 2-packs don't have any
|group by=method to combat Cargo duplicate storing glitches. Failsafe in place to prevent HTML/browser issues but name mapping still gets offset. - Currently, changes cannot be previewed. Theoretically this could be achieved through special treatment in say
/skin.php- perhaps taking the input variables and swapping in a different query output, this one set up likewhere= Case_str='{{{car1|}}}' or Case_str='{{{car2|}}}'and so on.