Module:Concert location/doc
This is the documentation page for Module:Concert location
This Lua module is designed to automatically generate categories for concert pages based on the location, date, and artist provided in an infobox.
Features
- Detects U.S. states by abbreviation (e.g., "CA") or full name (e.g., "California").
- Detects non-U.S. countries by using the text after the last comma in the location string, with support for multi-word country names and common aliases (e.g., "London, UK" → "United Kingdom").
- Automatically prefixes "the" for country names when appropriate (e.g., "The Bahamas", "The Netherlands").
- Supports sorting by year, extracted from the date parameter in the infobox.
- Restricts automatic category creation to a predefined list of allowed artists.
Parameters
|location=
: The location of the concert as entered in the infobox.|date=
: The date of the concert (used to extract the year for sort keys).|artist=
: The performing artist (only allowed artists trigger automatic categories).
Usage
This module is intended to be invoked from an infobox template using #invoke and is not meant to be used on its own:
{{#invoke:Concert location|getCategory|{{{location}}}|{{{date}}}|{{{artist}}}}}
Examples
{{Infobox concert
| artist = Weezer
| location = Los Angeles, CA
| date = March 19, 1992
}}
Result: [[Category:Weezer concerts in California|1992]]
{{Infobox concert
| artist = Weezer
| location = London, United Kingdom
| date = August 1, 2022
}}
Result: [[Category:Weezer concerts in the United Kingdom|2022]]
Notes
- If the location is not recognized or the artist is not in the allowed list, no category is generated.
- The module assumes the last word in a non-U.S. location corresponds to the country.