Module:SongCertifications/doc
This is the documentation page for Module:SongCertifications
| This Lua module is used on many pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
This module is used by the {{Infobox song}} template to format the |certification= parameter and assign categories based on the certification level of a song.
Usage
The module is invoked within the {{Infobox song}} template as follows:
{{#invoke:SongCertifications|getCertification|certification={{{certification|}}}}}
The module processes the |certification= parameter and formats the output while adding appropriate categories:
Gold(case-insensitive): DisplaysGold ●and adds [[Category:Gold Songs]].- A number from
1to9: DisplaysNx Platinum ▲(e.g.,3x Platinum ▲for3) and adds [[Category:Platinum Songs]]. - A number
10or higher: DisplaysNx Diamond ⬥(e.g.,24x Diamond ⬥for24) and adds [[Category:Diamond Songs]]. - Invalid inputs (e.g., non-numeric values other than
Gold, or numbers less than1): Displays the input as-is and adds [[Category:Songs with Invalid Certifications]].
Example
In an article using the {{Infobox song}} template:
{{Infobox song
| name = Example Song
| type = Major Hit Song
| artist = Example Artist
| album = Example Album
| released = January 1, 2020
| genre = Pop
| certification = 24
| rating = 4
}}
This will display the certification as 24x Diamond ⬥ and add the article to [[Category:Diamond Songs]].
Notes
- The module is case-insensitive for
Gold(e.g.,gold,GOLDare accepted). - Invalid inputs, such as
23x Diamond ⬥or non-numeric values other thanGold, are displayed as entered and categorized in [[Category:Songs with Invalid Certifications]] for manual review. - Ensure the categories ([[Category:Gold Songs]], [[Category:Platinum Songs]], [[Category:Diamond Songs]], [[Category:Songs with Invalid Certifications]]) exist on the wiki to avoid redlinks.
See also
- {{Infobox song}} – The template that uses this module.
- Module:SongCategories – Handles type-based categories for the same template.