Fandom Developers Wiki
Advertisement

Icons is a global lua module that displays a string of standardised icons from an input string of text aliases. Due to being originally designed for the Fallout Wiki, it also includes some optional Semantic MediaWiki controls that can be enabled.

Description[]

The module has 6 parameters:

  • Param 1 (required): the list of icons
  • Setting (optional): the size of the icon if a standard size is required. Default options:
    • Small - x12px
    • Medium or normal - x14px
    • Large - x16px
  • Size (optional): allows for any icon size to be set. When requesting multiple icons, it is recommended to set this against the height (e.g. x14px) rather than the width (e.g. 14px) to ensure a consistent line.
  • Links (optional): the page the icon links to when clicked. For multiple icons these must be split by a comma.
  • Tooltips (optional): the text shown when hovering over the icon. Must be split by a comma.
  • Class (optional): CSS classes to be set against the icons.

The icons themselves are stored on a subpage in a table.

Module information

Functions

exists

Completes a null or empty check on a variable.

trim

Trims whitespace from a string.

p.moduleIcons

Call for other modules to create standarised icons.

p.Icons

Creates a string icons of consistent size within a span wrapper.
Parameters
NameTypepurpose
iconListstringThe icon short codes to process, each must be split with a comma.
iconSettingstring[opt] A text value of size that is checked to return an actual size.
iconLinksstring[opt] A list of articles for the icons to link to, each is split by a comma and maps exactly to iconList.
optstringA list of tooltip text to replace the icon defaults, maps exactly to iconList.
optstringAny additional CSS classes to be assigned to icons.
optstringTakes a single defined size and sets it against the icons. Overrides iconSetting.
optstringOnly renders an icon if not set or the icon has the series parameter set.

p.platforms

Creates a list of valid game platforms.
Parameters
NameTypepurpose
1stringA string of game short codes, each split by a comma.

p.documentation

Self generating function that displays all available icons and their short codes in a table set.

p.sortList

Maintenance function for sorting long icon Data lists. Results are passed to parser profile data for copying.
Advertisement