Template:Infobox song: Difference between revisions

No edit summary
(here we go!)
Line 1: Line 1:
<noinclude>{{#cargo_declare:_table=songs
<templatestyles src="Template:Infobox song/styles.css" /><templatestyles src="Template:Infobox/styles.css" /><noinclude>{{#cargo_declare:_table=songs
|name = String(mandatory=1)
|name = String(mandatory=1)
|type = List (,) of String (mandatory=1;allowed values=song,single,promo,cover,instrumental)
|type = List (,) of String (mandatory=1;allowed values=song,single,promo,cover,instrumental)
Line 12: Line 12:
|musicbrainz = String
|musicbrainz = String
|cover = File
|cover = File
}}</noinclude><includeonly><templatestyles src="Infobox song/styles.css" />{{#invoke:Infobox song|categories|{{lc:{{{type|{{{Type|}}}}}}}}|{{#invoke:String2|ucfirst|{{delink|{{{artist|}}}}}}}}}{{#invoke:Infobox song|validateOrFetchReleaseDate|{{{artist|}}}|{{{name|{{PAGENAME}}}}}|{{{released_cargo|{{{released|}}}}}}}}{{#cargo_store:_table=songs
}}</noinclude>{{#invoke:Infobox song|infobox|
|name = {{{name|{{PAGENAME}}}}}
|type = {{#if:{{{type|{{{Type|}}}}}}|{{lc:{{{type|{{{Type|}}}}}}}}|song}}
|artist = {{#invoke:String2|ucfirst|{{delink|{{{artist|}}}}}}}
|original_artist = {{delink|{{{original_artist|}}}}}
|main_album = {{delink|{{{album|{{{Album|}}}}}}}}
|song_release_date = {{#var:release_date|{{{released_cargo|{{{released|}}}}}}}}
|writer = {{delink|{{{writer|{{{Writer|}}}}}}}}
|video = {{#if:{{{video|}}}|1|0}}
|spotify = {{{spotify|}}}
|discogs = {{{discogs|}}}
|musicbrainz = {{{musicbrainz|}}}
|cover = {{{cover|}}}
}}{{#if:{{{is_ep|}}}|{{Infobox song/Album store|name={{{name|{{PAGENAME}}}}}|cover={{{cover|}}}|type=ep|artist={{#invoke:String2|ucfirst|{{delink|{{{artist|}}}}}}}|producer={{{producer|}}}|engineer={{{engineer|}}}|released={{{released|{{#var:release_date}}}}}|discogs={{{discogs|}}}|musicbrainz={{{musicbrainz|}}}}}}}</includeonly>{{ {{{|safesubst:}}}#invoke:Unsubst-infobox||$params=name,cover,cover_size,alt,border,caption,type,artist,side_project,album,EP,language,English_title,A-side,B-side,written,published,released,format,recorded,studio,venue,genre,length,label,writer,composer,lyricist,producer,chronology,prev_title,prev_title2,prev_year,title,title2,year,next_title,next_title2,next_year,tracks,misc|$set1={{{{{|safesubst:}}}#switch:{{{{{|safesubst:}}}lc:{{{type|{{{Type|}}}}}}}}|single|[[:Category:Singles|single]]|singles|[[:Category:Singles|singles]]=name,cover,cover_size,alt,border,caption,type,artist,side_project,{{{{{|safesubst:}}}#if:{{{EP|}}}|EP,|album,}}language,English_title,A-side,B-side,released,format,recorded,studio,venue,genre,length,label,{{{{{|safesubst:}}}#if:{{{writer|{{{Writer|}}}}}}|writer,|composer,lyricist,}}producer,chronology,prev_title,prev_title2,prev_year,{{{{{|safesubst:}}}#if:{{{title2|}}}|title,}}title2,year,next_title,next_title2,next_year,misc|name,cover,cover_size,alt,border,caption,type,artist,side_project,{{{{{|safesubst:}}}#if:{{{EP|}}}|EP,|album,}}language,English_title,released,format,recorded,studio,venue,genre,length,label,{{{{{|safesubst:}}}#if:{{{writer|{{{Writer|}}}}}}|writer,|composer,lyricist,}}producer,chronology,{{{{{|safesubst:}}}#if:{{{tracks|{{{Tracks|}}}}}}|tracks,}}misc}}|$set3=name,cover,cover_size,alt,border,caption,type,language,English_title,written,published,{{{{{|safesubst:}}}#if:{{{recorded|{{{Recorded|}}}}}}{{{length|{{{Length|}}}}}}|recorded,length,}}writer,composer,lyricist,misc|$extra=cover_size,border,caption,language,English_title,A-side,B-side,chronology,prev_title2,title2,year,next_title2,prev_no,next_no,prev,next,tracks,misc|$aliases={{{{{|safesubst:}}}#if:{{{title2|}}}||title>name,}}Name>name,image>cover,Cover>cover,cover size>cover_size,Cover size>cover_size,Alt>alt,Border>border,Caption>caption,Type>type,Artist>artist,Album>album,from_album>album,from Album>album,Language>language,english_title>English_title,Writer>writer,Composer>composer,Lyricist>lyricist,Written>written,Published>published,Genre>genre,Recorded>recorded,Studio>studio,Venue>venue,Length>length,Producer>producer,Released>released,Label>label,Format>format,a-side>A-side,b-side>B-side,Chronology>chronology,Tracks>tracks,Misc>misc|prev_track={{{{{|safesubst:}}}#if:{{{prev_track|}}}|{{{prev_track}}}|{{{{{|safesubst:}}}#if:{{{prev|}}}|{{{{{|safesubst:}}}#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}C|1={{{prev|}}}|2=^["“‘'](.+)["”’']$|nomatch=}}}}}}|prev={{{{{|safesubst:}}}#if:{{{prev|}}}|{{{{{|safesubst:}}}#if:{{{{{|safesubst:}}}#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}C|1={{{prev|}}}|2=^["“‘'](.+)["”’']$|nomatch=}}||{{{prev}}}}}}}|next_track={{{{{|safesubst:}}}#if:{{{next_track|}}}|{{{next_track}}}|{{{{{|safesubst:}}}#if:{{{next|}}}|{{{{{|safesubst:}}}#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}C|1={{{next|}}}|2=^["“‘'](.+)["”’']$|nomatch=}}}}}}|next={{{{{|safesubst:}}}#if:{{{next|}}}|{{{{{|safesubst:}}}#if:{{{{{|safesubst:}}}#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}C|1={{{next|}}}|2=^["“‘'](.+)["”’']$|nomatch=}}||{{{next}}}}}}}|prev_no={{{{{|safesubst:}}}#if:{{{prev_no|}}}|{{{{{|safesubst:}}}#ifeq:{{{{{|safesubst:}}}#expr:{{{track_no|0}}}-1}}|{{{prev_no}}}||{{{prev_no}}}}}}}|next_no={{{{{|safesubst:}}}#if:{{{next_no|}}}|{{{{{|safesubst:}}}#ifeq:{{{{{|safesubst:}}}#expr:{{{track_no|0}}}+1}}|{{{next_no}}}||{{{next_no}}}}}}}|chronology={{{{{|safesubst:}}}#if:{{{chronology|{{{Chronology|}}}}}}|{{{{{|safesubst:}}}#switch:{{{{{|safesubst:}}}lc:{{{type|{{{Type|}}}}}}}}|single|[[:Category:Singles|single]]|singles|[[:Category:Singles|singles]]={{{{{|safesubst:}}}#invoke:String|replace|error_category=Music infoboxes with Module:String errors{{!}}C|1={{{chronology|{{{Chronology}}}}}}|2=%s*singles$|5=false}}|{{{chronology|{{{Chronology|}}}}}}}}}}|recorded={{{{{|safesubst:}}}#if:{{{recorded|{{{Recorded|}}}}}}|{{{{{|safesubst:}}}#invoke:String|replace|error_category=Music infoboxes with Module:String errors{{!}}C|1={{{recorded|{{{Recorded}}}}}}|2=[ ]–[ ]|3={{snd}}|plain=false}}}}|$flags=override|$B={{Infobox
| bodyclass  = vevent
| bodyclass  = vevent
| aboveclass  = summary
| aboveclass  = summary
| abovestyle  = background-color: {{Infobox song/color|{{{type|{{{Type|}}}}}} }};
| abovestyle  = background-color: {{Infobox song/color|{{{type|{{{Type|}}}}}} }};
| above      = {{#vardefine:name|{{if empty|{{{name|}}}|{{{Name|}}}|{{#if:{{{title2|}}}||{{{title|}}}}}|{{PAGENAME}}}}}}"{{#var:name}}"


| image      = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|{{{cover|{{{Cover|}}}}}}}}}|size={{{cover_size|{{{cover size|{{{Cover size|}}}}}}}}}|upright={{{cover_upright|}}}|sizedefault=frameless|alt={{{alt|{{{Alt|}}}}}}|border={{{border|{{{Border|}}}}}}}}
| image      = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|{{{cover|{{{Cover|}}}}}}}}}|size={{{cover_size|{{{cover size|{{{Cover size|}}}}}}}}}|upright={{{cover_upright|}}}|sizedefault=frameless|alt={{{alt|{{{Alt|}}}}}}|border={{{border|{{{Border|}}}}}}}}
Line 45: Line 31:
-->{{#ifeq:{{yesno-yes|{{{lyrics|}}}}}|yes|<span><div class="mw-no-invert">[[File:Breezeicons-actions-22-view-media-lyrics.svg|40px|link=#Lyrics|alt=Lyrics]]</div>[[#Lyrics|Lyrics]]</span>|[[Category:Instrumental songs]]}}<!--
-->{{#ifeq:{{yesno-yes|{{{lyrics|}}}}}|yes|<span><div class="mw-no-invert">[[File:Breezeicons-actions-22-view-media-lyrics.svg|40px|link=#Lyrics|alt=Lyrics]]</div>[[#Lyrics|Lyrics]]</span>|[[Category:Instrumental songs]]}}<!--
-->{{#if:{{{notabs|}}}||{{#ifexist:Tab:{{PAGENAME}}|<span><div class="mw-no-invert">[[File:Guitar (23727) - The Noun Project.svg|40px|link=Tab:{{PAGENAME}}]]</div>[[Tab:{{PAGENAME}}|Tabs]]</span>|<span class="plainlinks"><div>[[File:Guitar (23727) - The Noun Project.svg|40px|link=https://www.ultimate-guitar.com/search.php?search_type=title&value={{urlencode:{{delink|{{{artist|The Smashing Pumpkins}}}}}|QUERY}}%20{{urlencode:{{{name|{{PAGENAME}}}}}|QUERY}}]]</div>[https://www.ultimate-guitar.com/search.php?search_type=title&value={{urlencode:{{delink|{{{artist|The Smashing Pumpkins}}}}}|QUERY}}%20{{urlencode:{{{name|{{PAGENAME}}}}}|QUERY}} Tabs]</span>}}}}<!--
-->{{#if:{{{notabs|}}}||{{#ifexist:Tab:{{PAGENAME}}|<span><div class="mw-no-invert">[[File:Guitar (23727) - The Noun Project.svg|40px|link=Tab:{{PAGENAME}}]]</div>[[Tab:{{PAGENAME}}|Tabs]]</span>|<span class="plainlinks"><div>[[File:Guitar (23727) - The Noun Project.svg|40px|link=https://www.ultimate-guitar.com/search.php?search_type=title&value={{urlencode:{{delink|{{{artist|The Smashing Pumpkins}}}}}|QUERY}}%20{{urlencode:{{{name|{{PAGENAME}}}}}|QUERY}}]]</div>[https://www.ultimate-guitar.com/search.php?search_type=title&value={{urlencode:{{delink|{{{artist|The Smashing Pumpkins}}}}}|QUERY}}%20{{urlencode:{{{name|{{PAGENAME}}}}}|QUERY}} Tabs]</span>}}}}<!--
-->{{#if:{{{video|}}}|[[Category:Music videos]]{{#if:{{{side_project|}}}||[[Category:{{delink|{{{artist|{{{Artist|}}}}}}}} music videos]]}}<span><div>[[File:Video Camera - The Noun Project.svg|40x40px|link=#Music video]]</div>[[#Music video|Video]]</span>}}<!--
-->{{#if:{{{video|}}}|<span><div>[[File:Video Camera - The Noun Project.svg|40x40px|link=#Music video]]</div>[[#Music video|Video]]</span>}}<!--
-->{{#if:{{{spotify|}}}|<span class="plainlinks"><div>[[File:Spotify logo without text.svg|40px|link=https://open.spotify.com/track/{{{spotify}}}]]</div>[https://open.spotify.com/track/{{{spotify}}} Spotify]</span>}}
-->{{#if:{{{spotify|}}}|<span class="plainlinks"><div>[[File:Spotify logo without text.svg|40px|link=https://open.spotify.com/track/{{{spotify}}}]]</div>[https://open.spotify.com/track/{{{spotify}}} Spotify]</span>}}
</div>
</div>
Line 69: Line 55:


| label10    = Released
| label10    = Released
| data10      = {{#if:{{{nonstandard_artist|}}}||{{#if:{{{released|}}}|{{#invoke:cat year|parse|{{#dateformat:{{{released}}}|mdy}}|{{#ifeq:{{{type|}}}|single|single|}}}}|{{#if:{{{released_cargo|}}}|{{{released|}}}|{{#invoke:cat year|parse|{{#dateformat:{{#var:release_date}}|mdy}}|{{#ifeq:{{{type|}}}|single|single|}}}}}}}}}}
| class10    = plainlist
| class10    = plainlist


Line 77: Line 62:


| label12    = {{#if:{{{recorded|}}}|Recorded<includeonly>[[Category:Infobox song using recorded parameter]]</includeonly>|[[Studio sessions]]}}
| label12    = {{#if:{{{recorded|}}}|Recorded<includeonly>[[Category:Infobox song using recorded parameter]]</includeonly>|[[Studio sessions]]}}
| data12      = {{#if:{{{recorded|}}}|{{{recorded}}}{{#if:{{{recorded_ref|}}}|{{{recorded_ref}}}}}|<includeonly>{{#vardefine:sessions|{{#invoke:infobox_song|studio_sessions|{{PAGENAME}}}}}}{{#var:sessions}}</includeonly>}}
| class12    = plainlist
| class12    = plainlist


| label13    = Studio
| label13    = Studio
| data13      = {{#if:{{#var:sessions}}||{{#invoke:link|studio|{{{studio|{{{Studio|}}}}}}}}}}
| class13    = plainlist
| class13    = plainlist


Line 100: Line 83:


| label40    = <span class="nowrap">Songwriter(s)</span>
| label40    = <span class="nowrap">Songwriter(s)</span>
| data40      = {{#if:{{{writer|{{{Writer|}}}}}}|{{#invoke:Link|writer|{{delink|{{{writer|{{{Writer|}}}}}}}}|{{{name|{{{title|{{PAGENAME}}}}}}}}|Song}}|(unknown) <includeonly>[[Category:Songs with unknown writers]]</includeonly>}}
| class40    = hlist
| class40    = hlist


Line 132: Line 114:


| belowclass = nomobile
| belowclass = nomobile
| below = {{{misc|{{{Misc|}}}}}}{{#vardefine:track_listing|{{#invoke:infobox song|track_listing|{{#var:name}}|{{delink|{{{album|}}}}}}}}}{{#if:{{#var:track_listing}}|{{hidden|class=nomobile|[[{{delink|{{{album}}}}}]]|{{#var:track_listing}}|headerstyle=background:{{Infobox song/color|{{{type|{{{Type|}}}}}}}}}}}}
}}{{main other|{{#if:{{{Type|}}}{{{Writer|}}}{{{Tracks|}}}{{{Recorded|}}}{{{Length|}}}{{{prev|}}}{{{next|}}}{{{prev_no|}}}{{{track_no|}}}{{{next_no|}}}{{{Chronology|}}}{{{Name|}}}{{{Cover|}}}{{{cover size|}}}{{{Cover size|}}}{{{Alt|}}}{{{Border|}}}{{{Caption|}}}{{{Artist|}}}{{{side_project|}}}{{{Album|}}}{{{from Album|}}}{{{Language|}}}{{{a-side|}}}{{{b-side|}}}{{{Written|}}}{{{Published|}}}{{{Released|}}}{{{Format|}}}{{{Studio|}}}{{{Venue|}}}{{{Genre|}}}{{{Label|}}}{{{Composer|}}}{{{Lyricist|}}}{{{Producer|}}}{{{prev_single|}}}{{{next_single|}}}{{{Misc|}}}{{{Last single|}}}{{{last_single|}}}{{{This single|}}}{{{this_single|}}}{{{Next single|}}}|[[Category:Pages using infobox song with deprecated parameters]]}}{{#invoke:Check for unknown parameters|check|unknown=[[Category:Pages using infobox song with unknown parameters|_VALUE_{{PAGENAME}}]]|preview=Page using [[Template:Infobox song]] with unknown parameter "_VALUE_"|ignoreblank=y|type|Type|EP|writer|Writer|title2|tracks|Tracks|recorded|Recorded|length|Length|prev_track|prev|next_track|next|prev_no|track_no|next_no|chronology|Chronology|name|Name|title|image|cover|Cover|cover_size|cover size|Cover size|cover_upright|alt|Alt|border|Border|caption|Caption|artist|Artist|nonstandard_artist|side_project|original_artist|album|Album|from_album|from Album|album_photo|notabs|spotify|video|language|Language|English_title|english_title|A-side|a-side|B-side|b-side|written|Written|published|Published|released|Released|format|Format|studio|Studio|venue|Venue|genre|Genre|label|Label|composer|Composer|lyricist|Lyricist|producer|Producer|prev_title|next_title|prev_single|next_single|__µ|prev_title2|prev_year|next_year|year|next_title2|misc|lyrics|Misc|discogs|musicbrainz|is_ep|released_cargo}}
}}{{main other|{{#if:{{{Type|}}}{{{Writer|}}}{{{Tracks|}}}{{{Recorded|}}}{{{Length|}}}{{{prev|}}}{{{next|}}}{{{prev_no|}}}{{{track_no|}}}{{{next_no|}}}{{{Chronology|}}}{{{Name|}}}{{{Cover|}}}{{{cover size|}}}{{{Cover size|}}}{{{Alt|}}}{{{Border|}}}{{{Caption|}}}{{{Artist|}}}{{{side_project|}}}{{{Album|}}}{{{from Album|}}}{{{Language|}}}{{{a-side|}}}{{{b-side|}}}{{{Written|}}}{{{Published|}}}{{{Released|}}}{{{Format|}}}{{{Studio|}}}{{{Venue|}}}{{{Genre|}}}{{{Label|}}}{{{Composer|}}}{{{Lyricist|}}}{{{Producer|}}}{{{prev_single|}}}{{{next_single|}}}{{{Misc|}}}{{{Last single|}}}{{{last_single|}}}{{{This single|}}}{{{this_single|}}}{{{Next single|}}}|[[Category:Pages using infobox song with deprecated parameters]]}}{{#invoke:Check for unknown parameters|check|unknown=[[Category:Pages using infobox song with unknown parameters|_VALUE_{{PAGENAME}}]]|preview=Page using [[Template:Infobox song]] with unknown parameter "_VALUE_"|ignoreblank=y|type|Type|EP|writer|Writer|title2|tracks|Tracks|recorded|Recorded|length|Length|prev_track|prev|next_track|next|prev_no|track_no|next_no|chronology|Chronology|name|Name|title|image|cover|Cover|cover_size|cover size|Cover size|cover_upright|alt|Alt|border|Border|caption|Caption|artist|Artist|nonstandard_artist|side_project|original_artist|album|Album|from_album|from Album|album_photo|notabs|spotify|video|language|Language|English_title|english_title|A-side|a-side|B-side|b-side|written|Written|published|Published|released|Released|format|Format|studio|Studio|venue|Venue|genre|Genre|label|Label|composer|Composer|lyricist|Lyricist|producer|Producer|prev_title|next_title|prev_single|next_single|__µ|prev_title2|prev_year|next_year|year|next_title2|misc|lyrics|Misc|discogs|musicbrainz|is_ep|released_cargo}}{{#if:{{{length|{{{Length|}}}}}}|{{#if:{{#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}C|1={{#invoke:hms|main|duration={{{length|{{{Length|}}}}}}}}|2=class="duration"|plain=true|nomatch=}}|[[Category:Articles with hAudio microformats]]}}{{#if:{{both|{{{writer|}}}{{{Writer|}}}|{{{composer|}}}{{{Composer|}}}}}|[[Category:Song articles with both composer and songwriter]]}}{{#if:{{both|{{{writer|}}}{{{Writer|}}}|{{{lyricist|}}}{{{Lyricist|}}}}}|[[Category:Song articles with both lyricist and songwriter]]}}{{#if:{{{lyricist|}}}{{{Lyricist|}}}|{{#if:{{{composer|}}}{{{Composer|}}}||[[Category:Song articles with lyricist but not composer]]}}}}}}{{#if:{{#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}C|1={{{name|}}}{{{cover|}}}{{{cover_size|}}}{{{alt|}}}{{{border|}}}{{{caption|}}}{{{type|}}}{{{artist|}}}{{{side_project|}}}{{{album|}}}{{{EP|}}}{{{language|}}}{{{English_title|}}}{{{writer|}}}{{{composer|}}}{{{lyricist|}}}{{{written|}}}{{{published|}}}{{{genre|}}}{{{recorded|}}}{{{studio|}}}{{{venue|}}}{{{length|}}}{{{producer|}}}{{{released|}}}{{{label|}}}{{{format|}}}{{{A-side|}}}{{{B-side|}}}{{{chronology|}}}{{{prev_title|}}}{{{prev_title2|}}}{{{prev_year|}}}{{{title|}}}{{{title2|}}}{{{year|}}}{{{next_title|}}}{{{next_title2|}}}{{{next_year|}}}{{{prev|}}}{{{prev_no|}}}{{{next|}}}{{{next_no|}}}{{{tracks|}}}{{{Name|}}}{{{image|}}}{{{Cover|}}}{{{cover size|}}}{{{Cover size|}}}{{{Alt|}}}{{{Border|}}}{{{Caption|}}}{{{Type|}}}{{{Artist|}}}{{{original_artist|}}}{{{Album|}}}{{{from_album|}}}{{{from Album|}}}{{{Language|}}}{{{english_title|}}}{{{Writer|}}}{{{Composer|}}}{{{Lyricist|}}}{{{Written|}}}{{{Published|}}}{{{Genre|}}}{{{Recorded|}}}{{{Studio|}}}{{{Venue|}}}{{{Length|}}}{{{Producer|}}}{{{Released|}}}{{{Last single|}}}{{{last_single|}}}{{{This single|}}}{{{this_single|}}}{{{Next single|}}}{{{next_single|}}}{{{Label|}}}{{{Format|}}}{{{a-side|}}}{{{b-side|}}}{{{Chronology|}}}{{{Tracks|}}}x|2=</?t[drh][ >]|nomatch=}}|[[Category:Music infoboxes with malformed table placement|S]]}}}}
}}<noinclude>
}}<includeonly>[[Category:Songs]]</includeonly><noinclude>
<!-- please place language and category links on the /doc page and not here -->
<!-- please place language and category links on the /doc page and not here -->
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>