Module:Vehicles/doc

From Dune: Awakening Community Wiki
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 the following function(s):

  • get - renders a vehicle infobox using Template:VehicleInfobox.
  • type - validates the provided vehicle type and outputs the corresponding MediaWiki category if valid.

Usage

Render infobox for current vehicle page

On a vehicle page, where the page title matches (via slugification) a vehicle key in the dataset:

{{#invoke:Vehicles|get|{{BASEPAGENAME}}}}

Render infobox for a specific vehicle

A specific vehicle key can also be provided manually:

{{#invoke:Vehicles|get|Sandbike}}

Safe wiki category output

Vehicle types are validated against VEHICLE_TYPES below. If valid, the corresponding MediaWiki category is returned. Ignored, invalid or unknown types produce no output.

{{#invoke:Vehicles|type|Ground}}

Parameters

get

1
string
The vehicle name. This is slugified before lookup, so it does not need to exactly match the key casing/formatting used in Module:Vehicles/data.
Returns an error message if no vehicle is specified, or if the slugified name has no match in the dataset.

type

1
string
A vehicle type. This is slugified before lookup against VEHICLE_TYPES below.

Notes

get

  • Display strings (name, vehicle type, and category label) are resolved via MessageBundle:Vehicles using the page's current language, with the English source also resolved separately for use as internal/category-facing values.