Module:Sandbox/TheThomanski/SongContestData/doc
| This is a documentation subpage for Module:Sandbox/TheThomanski/SongContestData. It may contain usage information, categories and other content that is not part of the original module page. |
| This module is rated as pre-alpha. It is incomplete and may or may not be in active development. Do not use it in article namespace pages. A module remains in pre-alpha until its developer, or another editor who adopts it if it is abandoned for some time, considers the basic structure complete. |
| This module depends on the following other modules: |
Implements Template:SongContestData
Subpages
[edit]Usage
[edit]Data tables
[edit]The module looks for data in Module:Sandbox/TheThomanski/SongContestData/, with {{{1}}}/{{{2}}}{{{1}}} being the contest, and {{{2}}} being the year. All of these subpages should return a table consisting of a list of entries, identified by the ISO country code of the country that competed. Each of these entries consist of another table, with a list of all attributes of the entry, as shown below:
return {
al = {
number = 1,
artist = 'Singer',
title = 'Song',
-- etc
},
ad = {
-- attributes
},
am = {
-- attributes
},
-- etc
}
Attributes
[edit]Below is a full list of all the attributes that the data templates may use:
| Attribute | Value | Description | Example |
|---|---|---|---|
number |
number |
Unique entry number of the song in the contest; increases with every new entry across all editions of the contest. | number = 1556, |
broadcaster |
string |
The broadcaster that provided the entry. Must be an identifier from Template:Broadcaster for the corresponding country. | broadcaster = 'avrotros', |
artistn |
string |
The nth artist's stage name. Must only be used when the artist uses a stage name with that entry (i.e. no first + last name). The n digit may be omitted if they're the first or only artist. Do not use the same n digit for artist_firstn and artist_lastn in the case of combining multiple artists. |
artist = '5miinust',artist2 = 'Puuluup', |
artist_firstn |
The nth artist's first and last name. Must always be used in combination with each other, using the same n digit. The n digit may be omitted if they're the first or only artist. Do not use the same n digit for artistn in the case of combining multiple artists. |
artist_first = 'Zala',artist_last = 'Kralj',artist_first2 = 'Gašper',artist_last2 = 'Šantl', | |
artist_lastn | |||
artist_articlen |
Wikipedia article name of the nth artist. The n digit may be omitted if they're the first or only artist. All artists should generally have a link to the artist's article or a redirect to an article. Please note WP:NOTBROKEN. |
article_artist = 'zalagasper', | |
artist_onelink |
boolean |
Used by Template:SongContestArtist. When set to true, it takes artist_article1 and spans the link over all artists, instead of an individual link for every artist. |
artist_onelink = true, |
artist_featn |
string |
The nth featuring artist's stage name. Must only be used when the artist uses a stage name with that entry (i.e. no first + last name). The n digit may be omitted if they're the first or only artist. Do not use the same n digit for artist_feat_firstn and artist_feat_lastn in the case of combining multiple artists. |
|
artist_feat_firstn |
The nth featuring artist's first and last name. Must always be used in combination with each other, using the same n digit. The n digit may be omitted if they're the first or only artist. Do not use the same n digit for artist_featn in the case of combining multiple artists. |
||
artist_feat_lastn | |||
artist_feat_articlen |
Wikipedia article name of the nth featuring artist. The n digit may be omitted if they're the first or only artist. All artists should generally have a link to the artist's article or a redirect to an article. Please note WP:NOTBROKEN. | ||
artist_feat_onelink |
boolean |
Used by Template:SongContestArtist. When set to true, it takes artist_feat_article1 and spans the link over all artists, instead of an individual link for every artist. |
|
title | |||
title_article | |||
title_lang | |||
title_native | |||
title_native_script | |||
lang | |||
writer | |||
sf | |||
sf_draw | |||
sf_pl | |||
sf_pt | |||
sf_q | |||
gf | |||
gf_draw | |||
gf_pl | |||
gf_pt |
Functions
[edit]main
[edit]Returns an attribute value from an entry
{{#invoke:Sandbox/TheThomanski/SongContestData|main}}
- Required parameters
| Parameter | Description |
|---|---|
|1= |
Contest |
|2= |
Year |
|3= |
Entry |
|4= |
Attribute |
- Examples
{{#invoke:Sandbox/TheThomanski/SongContestData|main|esc|2019|no|artist}}{{#invoke:Sandbox/TheThomanski/SongContestData|main|esc|2019|no|title}}Spirit in the Sky{{#invoke:Sandbox/TheThomanski/SongContestData|main|esc|2019|no|gf_pt}}331
entryAmount
[edit]Returns the amount of entries in a given contest year
{{#invoke:Sandbox/TheThomanski/SongContestData|entryAmount}}
- Required parameters
| Parameter | Description |
|---|---|
|1= |
Contest |
|2= |
Year |
- Optional parameters
| Parameter | Description |
|---|---|
|3= |
Show |
- Examples
{{#invoke:Sandbox/TheThomanski/SongContestData|entryAmount|esc|2019}}41{{#invoke:Sandbox/TheThomanski/SongContestData|entryAmount|esc|2019|sf}}35{{#invoke:Sandbox/TheThomanski/SongContestData|entryAmount|esc|2019|sf1}}17{{#invoke:Sandbox/TheThomanski/SongContestData|entryAmount|esc|2019|sf2}}18{{#invoke:Sandbox/TheThomanski/SongContestData|entryAmount|esc|2019|gf}}26
order
[edit]Returns a sorted table of the entries from a contest.
- Required parameters
| Parameter | Description |
|---|---|
|1= |
Contest |
|2= |
Year |
- Optional parameters
| Parameter | Description | Default |
|---|---|---|
|3= |
Attribute to sort. If unset, the function defaults to sorting by its common country name in English | |
|desc= |
Sorts descending if set, otherwise sorts ascending | |
|excludeAtt='String' |
Excludes entries with set attribute | |
|excludeVal=value |
Excludes entries where the value of the |excludeAtt= attribute is equal to this parameter |
|
|excludeInvert=true/false |
Inverts exclusion. Excludes entries where the value of the |excludeAtt= attribute is not equal to |excludeVal= |
false |