Module:Versions/doc
Jump to navigation
Jump to search
This is the documentation page for Module:Versions
Module:Versions
Provides utility functions related to game versions by pulling all existing version pages by title, without the need to maintain a separate dataset.
This module provides the following function(s):
latest- returns the latest version string.check- returns whether a given version string has a corresponding version page.get- renders an InfoboxNavRow with theprevandnextversions populated correspondingly.
Usage
Return latest version
Returns the latest version, i.e. the highest version number among the version pages, as a string.
{{#invoke:Versions|latest}}
Check whether a version exists
Returns true if a version page with the given title exists, or false otherwise.
{{#invoke:Versions|check|1.3.15.0}}
Inside Template:VersionInfobox
The module is invoked by the template to render navigation buttons.
{{#invoke:Versions|get|{{{version|{{BASEPAGENAME}}}}}}}
The version parameter defaults to the current page name if not specified. The module returns a Template:InfoboxNavRow invocation with the previous and next update versions as parameters.
Parameters
latest
- <No parameters>
check
- 1
- string
- The version string to look up, matching a version page title.
get
- 1
- string
- The version string corresponding to a version page title.
Notes
- The third segment of a version must be either
0or two digits long, so1.3.5.0MUST be written as1.3.05.0. This keeps the module's order consistent with Template:VersionNavbox, which sorts by title.- Pages that do not follow the rule are ignored by the module, and their infobox shows an error.