Template:Vehicle infobox: Difference between revisions

From Pixar Cars Wiki
Jump to navigation Jump to search
 
(100 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{#cargo_declare:_table=Vehicles
<noinclude><!--
// Cargo table declaration (see Special:CargoTables/Vehicles)
-->{{#cargo_declare:_table=Vehicles
|Name=String
|Name=String
|Image=File
|Origin=String
|Character_name=String
|Character_name=String
|Origin=Wikitext string
|Photo=Wikitext
|Debut=Wikitext string
|Notes=Wikitext string
}}</noinclude><includeonly>{{#cargo_store:_table=Vehicles
|Edit=Wikitext string
|Name={{{name|{{PAGENAME}}}}}
|Link=Wikitext
|Image={{{image|}}}
}}</noinclude><includeonly><!--
|Character_name={{{character|{{PAGENAME}}}}}
// Strip ' and " characters from name values for database calls (is there a cheaper way to do this?)
|Origin={{#switch: {{{origin|}}}
-->{{#vardefine:full_name|{{Vehicle|{{PAGENAME}}|{{#if:{{{full_name|}}}|{{{full_name|}}}|{{PAGENAME}}}}}}}}{{#vardefine:escape|{{#replace:{{{sort_name|{{#replace:{{PAGENAME}}|"|}}}}}|&#34;|}}}}<!--
|Cars | ''Cars'' | [[Cars]] | ''[[Cars]]'' = ''[[Cars]]''
-->{{#vardefine:char_esc|{{#replace:{{{character|{{PAGENAME}}}}}|"|}}}}<!--
|Cars 2 | ''Cars 2'' | [[Cars 2]] | ''[[Cars 2]]'' = ''[[Cars 2]]''
Return the final "origin" value
|Cars 3 | ''Cars 3'' | [[Cars 3]] | ''[[Cars 3]]'' = ''[[Cars 3]]''
-->{{Origin index|1={{{origin|}}}}}__NOTOC__</includeonly>
|Cars on the Road | ''Cars on the Road'' | [[Cars on the Road]] | ''[[Cars on the Road]]'' | Cars On the Road | Cars On The Road = ''[[Cars on the Road]]''
|{{{origin|}}}}}
|First_release={{{first_release|}}} {{#if: {{{year|}}} | {{Smallnote{{!}}({{{year|}}})}} | }}
|Photo={{{image|}}}
}}</includeonly><div style="display:none">{{{name|{{PAGENAME}}}}}</div>
{{infobox|start|id=vehicle|style=border: 6px solid black;|outer_style=background:#fff;padding:8px;border-radius:10px; width: 100%;float: none; margin: 0 auto;}}
{{infobox|start|id=vehicle|style=border: 6px solid black;|outer_style=background:#fff;padding:8px;border-radius:10px; width: 100%;float: none; margin: 0 auto;}}
{{infobox|image|style={{#switch:{{{origin|}}}
{{infobox|image|style=background:#{{#var:bgcolor}}|image={{{image|}}}}}
  | Cars | cars | [[Cars]] | ''Cars'' | ''[[Cars]]'' | 1 = background:#ebd1d0; color:black
{{infobox|row|label=First release|data={{#if:{{{first_release|}}}|{{{first_release|}}}|<div id="first-release">{{#cargo_query:table=Releases
  | Cars 2 | cars 2 | [[Cars 2]] | ''Cars 2'' | ''[[Cars 2]]'' | 2 = background:#cfe6f8; color:black
|fields=Series_string,CONCAT( '<small>(', Year, ')</small>' )
  | Cars 3 | cars 3 | [[Cars 3]] | ''Cars 3'' | ''[[Cars 3]]'' | 3 = background:#d4e8cc; color:black
|where=_pageID='{{PAGEID}}' AND RelID='1'
  | Cars on the Road | cars on the road | [[Cars on the Road]] | ''Cars on the Road'' | ''[[Cars on the Road]]'' | OTR = background:#fefbc4; color:black
|limit=1
  | Cars Toon | T | ''Tokyo Mater'' | ''[[Tokyo Mater]]'' | ''Tokyo Mater'' | Tokyo Mater = background:#ccc3de;
|more results text=
  | background: #fff;}}|image={{{image|}}}}}
|delimiter=
{{infobox|row|label=First release|data={{{first_release|}}} {{#if: {{{year|}}} | {{Smallnote{{!}}({{{year|}}})}} |}}}}
}}</div>}}}}<!--
{{infobox|row|label=Origin|data={{#switch: {{{origin|}}}
// Now output row -->
|Cars | ''Cars'' | [[Cars]] | ''[[Cars]]'' = ''[[Cars]]''<includeonly>[[Category:Cars vehicles]]</includeonly>
{{infobox|row|label=Origin|data=[[List of die-casts by appearance/{{#var:origin}}|''{{#var:origin}}'']][[Category:{{#var:origin}} vehicles]]}}<!--
|Cars 2 | ''Cars 2'' | [[Cars 2]] | ''[[Cars 2]]'' = ''[[Cars 2]]''<includeonly>[[Category:Cars 2 vehicles]]</includeonly>
// Count how many vehicles are tied to the same character, then output the row
|Cars 3 | ''Cars 3'' | [[Cars 3]] | ''[[Cars 3]]'' = ''[[Cars 3]]''<includeonly>[[Category:Cars 3 vehicles]]</includeonly>
-->{{#vardefine:count|{{#cargo_query:table=Vehicles
|Cars on the Road | ''Cars on the Road'' | [[Cars on the Road]] | ''[[Cars on the Road]]'' | Cars On the Road | Cars On The Road = ''[[Cars on the Road]]''<includeonly>[[Category:Cars on the Road vehicles]]</includeonly>
|{{{origin|}}}}} }}
{{infobox|row|id=versions{{#cargo_query:table=Vehicles
  |no html
  |no html
  |fields=count(*)
  |fields=count(*)
  |default=0
  |default=0
  |where=Character_name="{{{character|{{PAGENAME}}}}}"
  |where=Character_name="{{#var:char_esc}}"
}}|label={{#ifeq:{{{name|{{PAGENAME}}}}}|{{{character|{{PAGENAME}}}}}|Versions|Version of}}|data=<div id="vehicle-vers">
}}}}
{{infobox|row|id=versions{{#var:count}}|label={{#ifeq:{{#var:escape}}|{{#var:char_esc}}|Versions|Version of}}|data=<div id="vehicle-vers">
{{!C}} class="mw-collapsible mw-collapsed" width=100% cellspacing=0
{{!C}} class="mw-collapsible mw-collapsed" width=100% cellspacing=0
! class="vehicle-verslist" style="background: none !important;color:black !important; text-align: left;padding: 0;position:relative;font-size: 100%;font-weight: normal;"{{!}}<span id="versions-basename">
! class="vehicle-verslist" style="background: none !important;color:black !important; text-align: left;padding: 0;position:relative;font-size: 100%;font-weight: normal;"{{!}}<span id="versions-basename">
{{#ifeq:{{{name|{{PAGENAME}}}}}|{{{character|{{PAGENAME}}}}}|<span style="font-weight:bold">{{#cargo_query:table=Vehicles
{{#ifeq:{{#var:escape}}|{{#var:char_esc}}|<span style="font-weight:bold">{{#var:count}}</span>|{{Vehicle|{{#var:char_esc}}}}}}</span>&nbsp;<span id="see-all">(''see all'')</span>
|no html
|fields=count(*)
|default=0
|where=Character_name="{{{character|{{PAGENAME}}}}}"
}}</span>|{{Vehicle|{{{character|{{PAGENAME}}}}}}}|}}</span>&nbsp;<span id="see-all">(''see all'')</span>
{{!}}-
{{!}}-
{{!}}style="background: none !important; color:black !important; font-size: 12px; border-top: 1px solid gray;"{{!}}{{#cargo_query:table=Vehicles
{{!}}style="background: none !important; color:black !important; font-size: 12px; border-top: 1px solid gray;"{{!}}{{#cargo_query:table=Vehicles
  |format=ul
  |format=ul
  |fields=CONCAT( '{{Vehicle|', Name, '}}' )
  |fields=Link
  |where=Character_name="{{{character|{{PAGENAME}}}}}"
  |where=Character_name="{{#var:char_esc}}"
|order by=Name
}}
}}
{{table end}}
{{table end}}
</div>
</div>}}
}}
{{Infobox|end}}{{Br}}<includeonly><!--
{{infobox|row|label=Total series|data={{{total_series|}}}}}
// Add vehicle/character tabber
{{Infobox|end}}{{Br}}<includeonly>{{Title icon|Character|character={{{character|{{PAGENAME}}}}}}}{{#if:{{{defaultsort|}}}|{{DEFAULTSORT:{{{defaultsort|}}}}}|}}</includeonly><noinclude>
-->{{Title icon|Character|character={{{character|{{PAGENAME}}}}}}}<!--
// DEFAULTSORT for category index listings
-->{{DEFAULTSORT:{{#var:escape}}}}<!--
// Store the Cargo data
-->{{#cargo_store:_table=Vehicles
|Name={{#var:escape}}
|Link={{v|{{PAGENAME}}}}
|Character_name={{#var:char_esc}}
|Photo={{#if:{{{image|}}}|[[File:{{{image|}}}|{{{size|100px}}}]]|{{no-image}}}}
|Origin={{#var:origin}}
|Notes={{#if:{{{note1|}}} | {{Notes|{{{note1|}}}|{{{note2|}}}|{{{note3|}}}|{{{note4|}}}|{{{note5|}}}|{{{note6|}}}|{{{note7|}}}|{{{note8|}}}}} | &ndash;}}
|Edit=[https://www.pixarcarswiki.com/{{FULLPAGENAMEE}}?action=edit&section=0 edit]
}}</includeonly><noinclude>
The '''vehicle infobox''' displays basic statistics about every [[Pixar Cars Wiki:The Diecast Project|vehicle]], and forms the upper section of their page. Compared to the subsequent [[Template:Die-cast row|Releases]] table, which details every singular iteration of that vehicle, the infobox is meant to "synthesize" their overall history and provide the core, invariable attributes, like what movie they're from and who they represent.
The '''vehicle infobox''' displays basic statistics about every [[Pixar Cars Wiki:The Diecast Project|vehicle]], and forms the upper section of their page. Compared to the subsequent [[Template:Die-cast row|Releases]] table, which details every singular iteration of that vehicle, the infobox is meant to "synthesize" their overall history and provide the core, invariable attributes, like what movie they're from and who they represent.



Latest revision as of 15:00, 12 August 2024

This template defines the Cargo table "Vehicles".

View table.

First release
No results
Origin '
Versions

0 (see all)

No results

The vehicle infobox displays basic statistics about every vehicle, and forms the upper section of their page. Compared to the subsequent Releases table, which details every singular iteration of that vehicle, the infobox is meant to "synthesize" their overall history and provide the core, invariable attributes, like what movie they're from and who they represent.

Predictably, the template parameters correspond to the first group of fields in the entry form. The only exception is |name=, which is equivalent to the title you enter before hitting "create"; if you want to change it, you will unfortunately have to back out and re-submit the name.

The other fields work as follows:

Form label Template parameter Explanation
Image |image= A loose photo of the titular vehicle. This should always portray their basic vehicle whenever possible; if the character does not have one, but has released in special or non-1:55 lines like the Mini Racers, those respective versions should be used instead.

Generally speaking, the preferred basic vehicle shot is their official "stockbook" render – this referring to the right-facing, angled image traditionally used in pamphlets, cardbacks, and the Mainline posters. However, these are not always available in sufficient quality, and in some rare cases (like certain Final Lap models) may never have been revealed at all. Here, the fallback should be the official photograph used by retailers like Amazon; only at last resort should a collector-taken photograph be included.

First release |first_release= Fairly straightforward, this identifies the very first series in which that character or version thereof made their debut in the line. Per above, this will not always necessarily be as a basic 1:55 die-cast, as some characters have appeared first in the miniature or other-scaled lines.
Origin |origin= Meanwhile, this field tracks what Cars (or Planes) franchise installment the modeled character first appeared in.
Character |character= The corresponding title of the character's in-universe basis, to be linked by the title icon. If left blank, the value defaults to that of |name= (i.e. the page title) on submission. However, it needs to be entered in situations where the traditional Mattel release name differs from their "common" series name (see Tow and his die-cast doppelganger Race Tow Truck Tom), but most often when the model is a unique "version" of a prior character, a la One Eye Mater or Dinoco Lightning McQueen.

The character input is highly important in relation to the last visible data row, Version/s of, which serves as navigation between all a character's versions. Thanks to some system magic, it does not actually require any manual input &ndash: rather, the list is automatically generated and updated by querying the database table and returning all instances where |name= and |character= are equivalent. Each result outcome returns a bulleted list of versions, but the labels are determined as follows:

  • If |name= =/= |character=, the Version of label appears along with the linked title of the "prime" version (the value of |character=)
  • If |name= = |character=, and at least one other vehicle in the database shares that same |character= value, the Versions label appears along with the total number of results.
  • If |name= = |character=, but no other vehicles share that same |character= value, nothing will appear at all.