Template:Vehicle row: Difference between revisions
RodRedlineM1 (talk | contribs) |
RodRedlineM1 (talk | contribs) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{Vehicle templates}} | <noinclude>{{Vehicle templates}} | ||
{{#cargo_declare:_table=Releases | {{#cargo_declare:_table=Releases<!-- | ||
|NumID=Integer | // Row number on page, used for the edit section shortcut. | ||
|RelID=Integer | -->|NumID=Integer<!-- | ||
|Rel=Integer | // Release number. unreleased don't add +1 | ||
|Model_name=Wikitext string | -->|RelID=Integer<!-- | ||
|Namestring=Wikitext | // VEHICLE release status; 0 = unreleased, 1 = released. | ||
-->|Rel=Integer<!-- | |||
// Formatted model name with link (page name) and "Model_name" input, along with a custom ID (ToyNo_year) for anchoring | |||
-->|Model_name=Wikitext string<!-- | |||
// By contrast, this is an escaped version of the model_name (or sort_name) input, stripping any " and ' (to avoid SQL conflicts). THIS is what different tables (series, cases, etc.) will match against. | |||
-->|Namestring=Wikitext | |||
|Format=String | |Format=String | ||
|Year=Wikitext | |Year=Wikitext | ||
Line 41: | Line 46: | ||
// | // | ||
// misc. general | // misc. general | ||
-->{{#vardefine:loose_photo|{{#if: {{{photo|}}} | [[File:{{{photo|}}}|{{{size|100x80px}}}]] | {{no-image}} }}}}<!-- | |||
-->{{#vardefine:year|{{{year|}}}}}<!-- | -->{{#vardefine:year|{{{year|}}}}}<!-- | ||
-->{{#vardefine:year_display|{{#if:{{{year|}}}|[[List of vehicles by year/{{{year|}}}|{{{year|}}}]]|{{n/a}}}}}}<!-- | |||
-->{{#vardefine:sub_number|{{{sub_number|}}}}}<!-- | -->{{#vardefine:sub_number|{{{sub_number|}}}}}<!-- | ||
-->{{#vardefine:cast_number|{{#if:{{{cast|}}}|<span class="plainlinks">[https://www.pixarcarswiki.com/index.php?title=Special%3ACargoQuery&tables=Releases&fields=Loose_photo%3DLoose+photo%2C+Model_name%3DModel+name%2C+Collector_number%3DCollector+number%2C+Year%3DYear%2C+Series%3DSeries%2C+Segment%3DSegment%2C+Country%3DCountry%2C+Cast_number%3DCast+number%2C+Toy_number%3DToy+number%2C+Notes%3DNotes%2C+Edit%3DEdit+&where=Cast_number+like+%27%25{{{cast|}}}%25%27&join_on=&group_by=&having=&order_by%5B0%5D=&order_by_options%5B0%5D=ASC&limit=500&offset=&format= {{{cast|}}}]</span>|{{TBA}}}}}}<!-- | |||
-->{{#vardefine:toy_number|{{{toy|{{TBA}}}}}}}<!-- | -->{{#vardefine:toy_number|{{{toy|{{TBA}}}}}}}<!-- | ||
-->{{#vardefine:card_given|{{{card|{{{card2|}}}}}}}}<!-- | -->{{#vardefine:card_given|{{{card|{{{card2|}}}}}}}}<!-- | ||
// NOTES - for multipack contents, doesn't work in Cargo due to qinu contents at the moment. To be converted into template. | |||
-->{{#vardefine:format_note|<span>{{#switch: {{{format|}}} | |||
| 2-pack | Multipack = {{Notes|{{{format|}}}{{#if:{{{toy|}}}|; with {{#cargo_query:table=Releases | |||
|fields=Model_name | |||
|where=Toy_number like '%\>{{{toy|}}}%' and _pageID NOT LIKE '{{PAGEID}}' and Year LIKE '%{{{year|}}}%' and Toy_number not like '%TBA%' | |||
|delimiter=, | |||
|limit=36 | |||
}}|}}}} |}}</span>}}<!-- | |||
-->{{#vardefine:edit_shortcut|<span class="plainlinks">[https://www.pixarcarswiki.com/{{FULLPAGENAMEE}}?action=edit§ion={{#expr:{{#var:n}}+1}} edit]</span>}}<!-- | -->{{#vardefine:edit_shortcut|<span class="plainlinks">[https://www.pixarcarswiki.com/{{FULLPAGENAMEE}}?action=edit§ion={{#expr:{{#var:n}}+1}} edit]</span>}}<!-- | ||
// | // | ||
// run through both series and segment indexes. This was initially designed to minimize switch statement runs before 'type' param was discontinued. Now likely to be converted into its own Cargo table set by the series pages' infoboxes, since we have to run a query each level due to Cases anyway. | // run through both series and segment indexes. This was initially designed to minimize switch statement runs before 'type' param was discontinued. Now likely to be converted into its own Cargo table set by the series pages' infoboxes, since we have to run a query each level due to Cases anyway. | ||
Line 52: | Line 67: | ||
-->{{Segment index|year={{{year|}}}|segment={{{segment|}}}|sub={{{sub|}}}|series={{{series|}}}}}<!-- | -->{{Segment index|year={{{year|}}}|segment={{{segment|}}}|sub={{{sub|}}}|series={{{series|}}}}}<!-- | ||
// | // | ||
-->{{#vardefine:col_number_rowfield|{{#if: {{{colno|}}} | {{Sortkey|{{Numbersort|{{{colno|}}}}}}}[[{{#var:colnumber}}|{{{colno|}}}]] | – }}}}<!-- | |||
// prepare sortkeys for the table display. | // prepare sortkeys for the table display. | ||
-->{{#vardefine:asst_sortkey|{{#ifeq:{{#var:asst}}|{{n/a}}|{{#var:toy_number}}|{{#var:asst}}}}}}<!-- | -->{{#vardefine:asst_sortkey|{{#ifeq:{{#var:asst}}|{{n/a}}|{{#var:toy_number}}|{{#var:asst}}}}}}<!-- | ||
Line 80: | Line 96: | ||
-->{{#vardefine:exclusive_display| | -->{{#vardefine:exclusive_display| | ||
{{Exclusive|1={{#var:exclusive_id}}}}}}<!-- | {{Exclusive|1={{#var:exclusive_id}}}}}}<!-- | ||
// | // | ||
//store data | //store data | ||
Line 95: | Line 103: | ||
|Rel={{#ifeq:{{{released|}}}|X|0|1}} | |Rel={{#ifeq:{{{released|}}}|X|0|1}} | ||
|International={{#if:{{{version|}}}|INT|NA}} | |International={{#if:{{{version|}}}|INT|NA}} | ||
|Model_name={{#if:{{{paired_names|}}}|{{{paired_names|}}}|[[{{FULLPAGENAME}}#{{{toy|}}}_{{{year|}}}|{{{model_name|{{#var:pagename | |Model_name={{#if:{{{paired_names|}}}|{{{paired_names|}}}|[[{{FULLPAGENAME}}#{{{toy|}}}_{{{year|}}}|{{{model_name|{{#var:pagename}}}}}]]}}{{#var:chasename}} | ||
|Namestring={{#var:escape_model_string}} | |Namestring={{#var:escape_model_string}} | ||
|Type=<!-- this probably will be moved to aforementioned series table. -->{{#var:ser_type}} | |Type=<!-- this probably will be moved to aforementioned series table. -->{{#var:ser_type}} | ||
|Format={{{format|}}} | |Format={{{format|}}} | ||
|Year={{# | |Year={{#var:year_display}} | ||
|Series={{M-series|released={{{released|}}}|series={{{series|}}}|year={{{year}}}}} | |Series={{M-series|released={{{released|}}}|series={{{series|}}}|year={{{year}}}}} | ||
|Sub={{{sub|}}} | |Sub={{{sub|}}} | ||
Line 109: | Line 117: | ||
| VN | Vietnam = {{M-country|VN}} | | VN | Vietnam = {{M-country|VN}} | ||
|{{TBA}}}} | |{{TBA}}}} | ||
|Collector_number= | |Collector_number={{#var:col_number_rowfield}} | ||
|Cast_number={{# | |Cast_number={{#var:cast_number}} | ||
|Toy_number={{Product number|{{{toy|}}}}} | |Toy_number={{Product number|{{{toy|}}}}} | ||
|Asst={{#var:asst}} | |Asst={{#var:asst}} | ||
Line 121: | Line 129: | ||
|C | Chase |SC | Super Chase = | |C | Chase |SC | Super Chase = | ||
|}}|–}}}}}} | |}}|–}}}}}} | ||
|Loose_photo={{# | |Loose_photo={{#var:loose_photo}} | ||
|Carded_photo={{{card|}}} | |Carded_photo={{{card|}}} | ||
|Card_2={{{card2|}}} | |Card_2={{{card2|}}} | ||
Line 135: | Line 143: | ||
-->{{#vardefine:cats|{{#ifeq:{{{paired|}}}|true|false|true}}}} | -->{{#vardefine:cats|{{#ifeq:{{{paired|}}}|true|false|true}}}} | ||
|- class="diecast-row type-{{#var:rowtype}} label-{{#var:labeltype}} filter-checked" id="{{{toy|}}}_{{{year|}}}" | |- class="diecast-row type-{{#var:rowtype}} label-{{#var:labeltype}} filter-checked" id="{{{toy|}}}_{{{year|}}}" | ||
|class="field_Photo"|{{# | | class="field_Photo"| {{#var:loose_photo}} | ||
| | | {{#var:col_number_rowfield}} | ||
|'''{{{model_name|{{#var:pagename}}}}}''' | | '''{{{model_name|{{#var:pagename}}}}}''' | ||
|class="field_Year" | | | class="field_Year" | {{#var:year_display}} | ||
|class="field_Series" | {{tooltip|text={{M-series|cats={{#var:cats}}|version={{{version|}}}|chase={{{chase|}}}|released={{{released|}}}|series={{{series|null}}}|year={{{year|}}}|sub={{{sub|}}}}}|content={{#if:{{#var:card_given}}|[[File:{{#var:card_given}}|120px]]|{{no-image}}}}}} | |class="field_Series" | {{tooltip|text={{M-series|cats={{#var:cats}}|version={{{version|}}}|chase={{{chase|}}}|released={{{released|}}}|series={{{series|null}}}|year={{{year|}}}|sub={{{sub|}}}}}|content={{#if:{{#var:card_given}}|[[File:{{#var:card_given}}|120px]]|{{no-image}}}}}} | ||
|class="field_Segment" | {{M-segment|{{{segment|}}}}}{{#ifeq:{{{paired|false}}}|true||{{#if:{{{segment|}}}|[[Category:{{#var:segment_category}}]]|}}}}{{Sortkey|{{{toy|}}}_{{{year|}}}}}<!--ensure 2-pack rows only combine with themselves--> | |class="field_Segment" | {{M-segment|{{{segment|}}}}}{{#ifeq:{{{paired|false}}}|true||{{#if:{{{segment|}}}|[[Category:{{#var:segment_category}}]]|}}}}{{Sortkey|{{{toy|}}}_{{{year|}}}}}<!--ensure 2-pack rows only combine with themselves--> | ||
|{{# | | {{#var:cast_number}} | ||
|{{#switch: {{{country|}}} | |{{#switch: {{{country|}}} | ||
| CN | China = {{M-country|CN|cats={{#var:cats}}}}{{#vardefine:china|{{Indicator}}}} | | CN | China = {{M-country|CN|cats={{#var:cats}}}}{{#vardefine:china|{{Indicator}}}} | ||
Line 153: | Line 161: | ||
| Single = {{#var:escape_model_string}} | | Single = {{#var:escape_model_string}} | ||
|}}|pair_name={{{pair|}}}}} | |}}|pair_name={{{pair|}}}}} | ||
| | | class="field_Notes" | {{#var:chasenote}}{{#var:format_note}}{{#if:{{{pair|}}}|{{Notes|Paired with {{v|{{{pair|}}}}}}}|}} | ||
{{#if:{{{pair|}}}|{{Notes|Paired with {{v|{{{pair|}}}}}}}| | |||
{{#if:{{{note1|}}} | {{Notes|{{{note1|}}}|{{{note2|}}}|{{{note3|}}}|{{{note4|}}}|{{{note5|}}}|{{{note6|}}}|{{{note7|}}}|{{{note8|}}}}} | {{#switch:{{{format|}}} | {{#if:{{{note1|}}} | {{Notes|{{{note1|}}}|{{{note2|}}}|{{{note3|}}}|{{{note4|}}}|{{{note5|}}}|{{{note6|}}}|{{{note7|}}}|{{{note8|}}}}} | {{#switch:{{{format|}}} | ||
|2-pack | Multipack = | |2-pack | Multipack = | ||
|{{#if:{{{chase|}}}|{{#switch: {{{chase|}}} | |{{#if:{{{chase|}}}|{{#switch: {{{chase|}}} | ||
|C | Chase |SC | Super Chase = | |||
|}}|–}}}}}} | |}}|–}}}}}} | ||
| {{#if:{{#var:exclusive}}|{{#var:exclusive_display}}|{{n/a}}}}<!--try to simplify within template--> | | {{{exclusive|{{#if:{{#var:exclusive}}|{{#var:exclusive_display}}|{{n/a}}}}}}}<!--try to simplify within template--> | ||
| | | class="field_Edit" | {{#var:edit_shortcut}}<!-- | ||
// | // | ||
// end and re-loop for each instance. once complete, cumulative stats are stored inside {{table end}} to the Vehicle_stats table. | // end and re-loop for each instance. once complete, cumulative stats are stored inside {{table end}} to the Vehicle_stats table. |
Latest revision as of 11:32, 22 September 2024
Diecast Project documentation | |
---|---|
Help pages | |
Vehicles · Releases · Series | |
Templates | |
Core | Utility |
infobox · table · row · list · case | poster sort · paired row · colno amend · series nav |
This template defines the Cargo table "Releases". |
Usage
The vehicle row
is the backbone of all Mattel Disney Pixar Cars coverage on the Pixar Cars Wiki. Compared to the {{vehicle infobox}}, which opens each vehicle page with a summarized overview, a number of vehicle rows form the core data table. – each one holding detailed, extensive information about an individual release of the vehicle thereof, allowing us to form a complete year-by-year, series-by-series, item-by-item record of that vehicle's history.
Component, needs to be wrapped by a {{table start}} {|
and {{table end}} |}
; The structured output is automated by the recommended entry form.
The stored data goes straight into a database table, allowing every other page on the wiki to access and use it. In short: A single vehicle row within a vehicle page defines the data for its respective release, which then every style of List page - whether series, #Cast lists|cast/item, or Chases - reads and includes in its generation. This gives a release the ability to appear on multiple pages, while only requiring a single edit to update everywhere else.
{| {{vehicle header}} |- {{vehicle row}} {{vehicle row}} {{vehicle row}} {{table end}}
Parameters
{{Vehicle row |model_name= |year= |series= |segment= |colno= |cast= |toy= |country= |photo= |size= |card= |note1= |note2= |note3= etc... }} |
|
Extra configuration
The following settings are not available in the main form, but can be configured in source mode.
|sort_name=
can be set to modify the "model name" that will be called by a {{vehicle list}}. This is useful in situations where more than one Vehicle within the same series have the same model name -- an example being Green, Yellow, and Purple Ramone in the 2007 Mainline. Setting the latter's|sort_name=
toPurple Ramone
makes it so when the same is put in {{poster sort}} template on the series page, it can identify said Ramone.|asst=
manually sets/overrides the assortment number. Most are covered automatically but for certain series/items where the programming cannot determine its identity (such as Piston Cup Nights and its varying multipack assortments), this is necessary.|exclusive=
sets the exclusive status of an item. Retailer-specific series display by default, but this works for individual items/overrides the default setting.
Temporary:
|sub=
allows for an extra level of specificity within series|card2=
and|int_card=
for alternate cardbacks; Walmart Cars and 2023 Mainline are examples
Also see {{paired row}} for paired singles