Template:Vehicle row
| Diecast Project code | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
| Templates | ||||||||||
| series list • series infobox • poster sort case • case header | ||||||||||
| Value indexes | ||||||||||
| ||||||||||
| Functions | ||||||||||
| Global: name escape • product no. • sortkey • numberSort Row output: m-series • m-segment • m-country • card checker • note checker* • edit shortcut Cases: printContent • storeContent Query tools: col - makeSeriesColumn • getCaseStats | ||||||||||
| Messages | ||||||||||
| Landing: top • bottom • year nav Search: results-header • results • button text | ||||||||||
| [src] |
<templatestyles src="Template:Banner notice/styles.css" />
Stores and displays data for one vehicle release, forming a complete year-by-year, series-by-series, item-by-item record of that vehicle's history.
Usage and documentation are covered as part of the releases guide.
Overview
Unlike queries/main interface, this template has two concurrent goals: Output the actual wikitext, and store some of it + certain raw values into the Releases table. Consequently the "code" is organized so that everything first will be calculated and stored in variables, from which each of the two functions then can pick and choose as they need.
Querying
| This article or section is under construction. Some or all info on this page is unfinished or inaccurate; Please help contribute by improving and proofreading the article. |
!! Don't try to follow these instructions until this notice goes away. Some info/lack of info reflects broader changes which aren't finished, or in some cases might just be flat out wrong.
Should you wish to play around with the database info, some knowledge is needed. Firstly, syntax for the {{#cargo_query:}} parser function, along with a very basic understanding of what the Cargo extension actually is – as much to know what is being queried, and what its natural limitations are (or aren't).
Secondly, that which this section hopes to offer, particulars of how this Cargo table and its many columns are built.
Beyond just storing data, each {{vehicle row}} must also prepare a complete, fully formatted table row for the output of its own page -- running the raw values through the same, multi-layered conditional statements they would when queried elsewhere. To save that future cost, it's convenient just to store those final cells and re-print them as-was. As a result, we find ourselves with two types of columns: The simple strings and numbers, the basic bricks in the LEGO bin – then of course, the sets on the shelf.
Fields
"Vanilla" formatting for each Vehicle Database column can be quickly imported via the {{Col}} template. To be safe, you might want to put Number anywhere a # would like to go.
{{#cargo_query:_table=Releases
|fields=
{{Col|Photo}},
{{col|Col. Number}},
{{col|Model Name}},
{{col|Year}},
{{col|Series}},
{{col|Segment}},
{{col|Cast Number}},
{{col|Made In}},
{{col|Toy Number}},
{{col|Asst Number}},
{{col|Case Number}},
{{col|Notes}},
{{col|Exclusive}},
{{Col|Edit}}
}}
| Field Name | Field Type | Relevant base column | Example value | Description and notes |
|---|---|---|---|---|
Loose_Photo
|
Wikitext
|
Photo | NameOfFile.jpg{{no-image}}{{n/a}}{{cargo null}} (default)
|
Concatenated File link allows the dimensions (100x100px in most mainspace queries) to be set as desired.
|
Col_Number
|
Wikitext string
|
Col. # | [[2013 (mainline series)#Festival Italiano Collection|1/9]]
|
Currently, the raw number is not immediately accessible. A RegEx could isolate it using the link pipe and closing brackets: \[\[(.*?)\|(.*?)\]\] -> $2
|
Series_Number
|
Integer
|
Series | Relevant to Mini Racers cell output | |
Model_Name
|
Wikitext string
|
Model Name | [[Dinoco Lightning McQueen#J6420_2006|Dinoco McQueen]]
|
Pre-formatted link anchored to the specific row on its origin page. |
Year
|
String
|
Year | 20XX (X= 0-9)ZZZ (null)
|
{{year link}} used for formatting |
Series
|
Wikitext string
|
Series | ...Very long (see inside m-series) | Fully formatted series "key" cell, with gradient color coding and series page link. The cardbacks tooltip is not included; due to extension conflicts, any {{#tooltip:}} must be created during output. This field is what goes in as the |text= parameter, while the |content= cardback display is constructed from the slot filenames.
|
Segment
|
Wikitext string
|
Segment | ...Very long See inside {{m-segment}} |
|
Cast_number
|
Wikitext string
|
Cast # | Formatted, explain like %H6406%
| |
Country
|
Wikitext string
|
Made In | ||
Toy_Number
|
Wikitext string
|
Toy # | ||
Asst
|
Wikitext string
|
Asst. # | DXV29{{n/a}}ZZZ (null)
| |
Case_str
|
Wikitext | Case # | L41472026_DXV99_01
|
Value to feed to {{getCaseStats}}, matched with Namestring column of Case_Contents. Equivalent to Toy_Number if |toy= in use, otherwise |toy_placeholder= or simply null(?)
|
Notes
|
Wikitext string
|
Notes | ||
Exclusive
|
Wikitext string
|
Exclusive | ||
Type
|
Integer
|
155Other
|
Used for the checkbox filters. | |
Edit
|
String
|
Anchored row link; used for edit shortcut button. | ||
International
|
String
|
Series | NA (default)INTL
|
Region |
Rel
|
Integer
|
Mostly impacts Series | 01 (default)
|
Whether or not the item was released (|released= has been set to X)
The |
Toy_Sortkey
|
Wikitext
|
Toy # | See logic in {{product number}} | |
| Case_MY | Integer | Case # | |0= (no, default)|1= (yes)
|
Whether Year column should be used for match with Case_Contents, i.e. when doing so would fail to display all cases across all relevant years. Must go in as specific parameter (doc) of {{getCaseStats}}.
|
Format
|
String
|
Notes | Single2-packMultipack
| |
Chase
|
Wikitext string
|
Notes | (null)Chase (Chase*)Super Chase(Super Chase**)
| |
Pack_Order
|
Integer
|
Notes | 1, 2, etc.0 (see right)99999 (default)
|
Default sort order for the "Multipack; with..." query and {{vehicles included}}. Setting to 0 will exclude them from those sorts of lists; useful for "vehicle playsets" i.e. Mack Truck Playset and etc.
|
RowID
|
Integer
|
12345_01
|
Unique key for a specific row; formatted simply as {{PAGEID}}_NumID. Commonly used as the group by field to guard against duplicate rows (see #Selection below).
| |
Sort_Name
|
Wikitext string
|
Cruisin Lightning McQueen
|
Escaped version of the Model Name input, stripping ", ', ® and other SQL-unfriendly characters. Necessary in case printouts so it can fit in an HTML attribute.
| |
| Additional columns (mostly irrelevant) | ||||
NumID
|
Integer
|
111111
|
Chronological position of the row within its Vehicle: page. Statistical applications seem limited by static structure of the wiki, but perhaps a use could be found.
| |
| Search_Utils | Wikitext string
|
Series | Cars,Holiday,Mini,Metallic | Keywords for the search interface. |
Card slots:
|Carded_photo=Wikitext string |Card_2=Wikitext |Card_3=Wikitext |Int_Card=Wikitext |Int_Card2=Wikitext |Int_Card3=Wikitext |ES_Card=Wikitext |RU_Card=Wikitext |RU_Card2=Wikitext |TR_Card=Wikitext |Card_New=Wikitext
Available templates
| Call | CONCAT() Skeleton |
Applications |
|---|---|---|
| {{makeSeriesColumn/ImageTemp}} | CONCAT( '{{!CC}}imageTemp{{!}}1{{equals}}, _fieldName, '{{!}}size{{equals}}100x100px{{!DD}}' )
|
Formats an image. Ideal for Loose_Photo or any cardback slot.
|
| {{sortkey}} | CONCAT( '{{!CC}}sortkey{{!}}1{{equals}}', _FieldName, '{{!DD}}' )
|
Prepended: Affect sorting behavior Appended: Insert a unique key and prevent combining via merge similar cells (if using table format)
|
| {{product number}} | CONCAT( '{{!CC}}product number{{!}}1{{equals}}', _FieldName, '{{!DD}}' )
|
Mostly redundant with above due to the fact the actual "sortkey" value can itself just be queried (Toy_Sortkey)
|
| {{str_replace}} | CONCAT( '{{!CC}}str_replace number{{!}}1{{equals}}', _FieldName, '{{!}}2{{equals}} [pattern] {{!}} [new text] {{!DD}}' )
|
See RegEx functions. Enables text tranformation on a data field via regular expression. |
{{#ifeq:{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}} }}
CONCAT( '', Releases.Model_Name, '{{!CC}}Chase{{!}}1{{equals}}', Releases.Chase, '{{!DD}}' )
Selection
The wiki content models rarely find much use for |group by=, but all of them use
|group by=RowID
--as built-in protection against row duplication, an occasional issue where the same row gets stored more than once (see link for info).
Because of how Cargo treats empty cells, a constant value—currently ZZZ— is typically stored to represent "null" state. The key itself can be typed in, or ideally, transcluded as {{cargo null}}. That way, if the constant value ever needs to be changed, your query won't also have to be updated accordingly.
|where=Loose_Photo="{{cargo null}}"
By contrast, most cells which can output as {{?}}, {{TBA}}, or {{n/a}} are stored exactly as that, and can be returned e.g. |where=Loose_Photo={{n/a}}
Most tables with which |join on= can be used, namely Case_Contents and Poster_orders, are designed to overlay Toy_Number and/or Asst_Number as well as Year.
Extensive queries can be hard on the server, and |limit= is hard-coded to max. 200 results. Exceeding which, the "More..." text will appear, forcing the remainder to be viewed through the Special:CargoQuery interface.