Module:EquipmentGallery/doc

From Dune: Awakening Community Wiki
Jump to navigation Jump to search

This is the documentation page for Module:EquipmentGallery

Module:EquipmentGallery

Parses Menu Garments images listed by DPL3 into captioned entries compatible with Template:Gallery.

This module should not be invoked directly. To add a dynamic image gallery to a Garment page, use Template:EquipmentGallery.

This module provides the following function(s):

  • main - parses a newline-separated list of Menu Garments filenames, generates captions from the filename structure, and returns sorted filename~caption lines.

Usage

Render a dynamic Garment gallery

{{#invoke:EquipmentGallery|main|{{ #dpl:
|namespace = File
|titlematch = Menu Garments%{{BASEPAGENAME}}%
|format = ,%TITLE%\n,,
}}}}

Parameters

main

1
string
Newline-separated list of filenames (without the File: namespace prefix).
2 (optional)
string
Override for the item name used as the parsing anchor within each filename.
Defaults to the current page's base title (BASEPAGENAME).

Notes

Filename format

The module expects filenames matching the following structure:

Menu Garments <GENDER> [SWATCH] <ITEM_NAME> [SIDE].jpg
GENDER
Masculine or Feminine. Required.
SWATCH
Zero or more words between GENDER and ITEM_NAME. Optional.
ITEM_NAME
Must match the item name parameter (defaults to BASEPAGENAME). Required.
SIDE
Front or Back. Optional.

Sort order

Output lines are sorted by the following priority:

  1. Swatch presence - unswatched images first, swatched images after.
  2. Swatch name - alphabetical within the swatched group.
  3. Gender - Masculine before Feminine.
  4. Side - Front before Back. Files without 'Front/Back' will be left as unspecified.

Error handling

Filenames that do not match the expected structure are appended at the end of the output without a caption, rather than producing an error.