Module:Vehicles/doc
Jump to navigation
Jump to search
This is the documentation page for Module:Vehicles
Module:Vehicles
Provides structured access to vehicle data defined in Module:Vehicles/data.
This module provides two functions:
get- renders a vehicle infobox using Template:VehicleInfoboxcategory- validates the provided vehicle type against Module:Vehicles/data and outputs the corresponding MediaWiki category if valid.
Usage
Render infobox for current vehicle page
On a vehicle page, where the page title matches a vehicle key in the dataset:
{{#invoke:Vehicles|get|{{PAGENAME}}}}
Render infobox for a specific vehicle
A specific vehicle key can also be provided manually:
{{#invoke:Vehicles|get|Sandbike}}
Render infobox without adding categories
An optional parameter can be used to prevent the infobox from adding the page to categories:
{{#invoke:Vehicles|get|Sandbike|omit=yes}}
Safe category output
Vehicle types are validated against definitions in Module:Vehicles/data. If valid, the corresponding MediaWiki category is returned. Invalid or unknown types produce no output.
{{#invoke:Vehicles|category|Ground}}
Parameters
get
- 1
- The vehicle key used in Module:Vehicles/data.
- omit (optional)
- If specified with a truthy value, the module will pass
omit_categories=yesto Template:VehicleInfobox. Accepted values:trueyes1
category
- 1
- A valid vehicle type string used in Module:Vehicles/data.
Notes
get
- If a vehicle key is not found in the dataset, a placeholder infobox is rendered using default values.