Help:Vehicle Database/Documentation
Jump to navigation
Jump to search
| Rules, info, and guidelines |
|---|
| Releases • Vehicles • Series • Cases Photos |
| Development notes |
| Foundation • Configuration |
| 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. |
The Vehicle Database is a set of interlinked Cargo tables built from our Mattel content pages.
Tables
- Releases - Main item table. Distinct assortments and products are stored into here, along with rows for individual vehicles contained in the latter (in the case of multipacks). Query settings select each type as needed.
- Case_Contents - Store info for cases and their respective contents, the former achieved by applying
group byto the latter. Joined to main table viaReleases.Case_str=Case_Contents.Namestring. - Vehicles - Cumulative/global info for a character. See list of vehicles by appearance.
Interface
Our custom search interface is built off the Cargo extension.
/extensions/Cargo/extension.json- Page registered to 'Special Pages' and 'Autoload Classes'. More convenient to keep here./includes/specials/CargoQueryDisplayer.php- Lines 198-203 amended to accommodate the PageImages extension whenmerge similar cellsis used. See here for explanation.CargoQueryPage.php- Various points changed to adjust if asearchkey=request value is null.SpecialVehicleDatabase.php- New file/original class extendingCargoQueryPage.php. Modeled after and lifts a couple elements fromSpecialCargoQuery.php.
/extensions/VehicleDatabase- Separate extension folder to handle the remaining stuff, including preference definitions and ResourceLoader system messages & stylesheets. See:
| Sheet/Script | Scope |
|---|---|
| Gadget-DiecastTables.css | Global |
| VehicleDatabasePage.css | Special:VehicleDatabase
|
| Gadget-VehicleTable.css | |
Vehicle: namespace
| |
| Gadget-VehiclePage.css | |
| Gadget-Cases.css | /Case assortments
|
| MediaWiki:Common.js | To be added (split) |
Messages:
Landing: top • bottom (year nav)
Search: Maintenance notice • results
/includes/specialpage/QueryPage.php- Both output pages extend this class, which defines the basic "query" system used all over MW, including reports, categories, and so on./includes/skins/Skin.php- Having obstructed the original logic, amend a fewstr_replace()rules to clean up whitespace within "nested query" text.
The actual storing and output systems are written entirely in wikitext, but are in the process of being converted to Lua.
Flow
Vehicles
| Outer | Inner | Description(s) |
|---|---|---|
| {{vehicle infobox}} | Global declarations:
{{title icon}} |
Output the leading "block" with initial vehicle info, and calculate some stats to eventually store into Vehicle_stats. |
| == Releases == | ||
| {{vehicle table}} |
|
|
| {{vehicle row}} | {{default variables}} {{series index}} {{exclusive index}} {{segment index}} {{m-country}} {{m-series}} {{m-segment}} {{vrow format/master}} | |
| {{table end}} | {{vehicle stats}} {{related models}} | |
Once stored into Releases, the VDB interface simply prints its own instance of {{vrow format/master}} via the template query format.
Cases
- {{case}}
- {{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.
Integration
- {{mattel series infobox}}
- {{current case}}
- {{mainline listings}}