Difference between revisions of "Template:BillboardURLbyName/doc"

From blackwiki
Jump to navigation Jump to search
imported>MSGJ
imported>Colin M
(Documentation rewrite. Update to reflect new functionality. Structured examples. Add TemplateData.)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[</nowiki>[[Wikipedia:Wikidata]]<nowiki>]]) -->
 
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[</nowiki>[[Wikipedia:Wikidata]]<nowiki>]]) -->
== Usage ==
 
This template returns the URL for the page about the artist on the Billboard site.
 
  
If called with the bio flag set to true, it will create a link to the artist's biography page, i.e. {{tlx|1=BillboardURLbyName|2=artist=Diddy|3=bio=true}} yields {{BillboardURLbyName|artist=Diddy|bio=true}}.
+
This template returns a billboard.com URL for an artist's history on a particular chart.
  
If the bio flag is not set, the chart paramenter will generate a link to the page showing the  given artist's performance on a specific chart. For example, {{tlx|BillboardURLbyName|artist{{=}}Shakira{{!}}chart{{=}}Hot 100}} will generate {{BillboardURLbyName|artist=Shakira|chart=Hot 100}}. The chart name mapping is documented at {{tl|BillboardChartNum}}. The artist name is case insensitive, but, aside from that, must match the one used on the Billboard site ''precisely'': no allowances are made for cases like "&" vs. "and", and Billboard is extremely inconsistent about the use of a leading "The" in a band's name.  
+
== Examples ==
 +
{{Aligned table |cols=3 |class=wikitable
 +
| '''Code'''                                                              | '''Output'''                                                  | '''Comments'''
 +
| {{tlc|BillboardURLbyName|artist{{=}}Carly Rae Jepsen|chart{{=}}Hot 100}} | {{BillboardURLbyName|artist=Carly Rae Jepsen|chart=Hot 100}}  |
 +
| {{tlc|BillboardURLbyName|artist{{=}}Carly Rae Jepsen|chart{{=}}Top Album Sales}} | {{BillboardURLbyName|artist=Carly Rae Jepsen|chart=Top Album Sales}}  |
 +
| {{tlc|BillboardURLbyName|artist{{=}}carly rae jepsen|chart{{=}}top album sales}} | {{BillboardURLbyName|artist=carly rae jepsen|chart=top album sales}} | Equivalent to above. Artist and chart are case insensitive.
 +
| {{tlc|BillboardURLbyName|artist{{=}}Carly Rae Jepsen|chart{{=}}all}} | {{BillboardURLbyName|artist=Carly Rae Jepsen|chart=all}}  | <code>chart{{=}}all</code> links to Billboard's "main" chart for the given artist (in this case, the Hot 100).
 +
| {{tlc|BillboardURLbyName|artist{{=}}Carly Rae Jepsen}}                  | {{BillboardURLbyName|artist=Carly Rae Jepsen}} | Billboard's landing page for this artist, including their chart history, and recent news and videos relating to the artist. Content at this URL is liable to drift over time. Not recommended.
 +
}}
  
If the chart is specified as "all", the link will be to the main chart page for the artist, using Billboards default "main chart". All charts are selectable from there.
+
== Usage ==
  
The Billboard name may not match Wikipedia's naming: for example, an article about a song by [[Kesha]] needs to use {{tlx|BillboardURLbyName|artist{{=}}Ke$ha{{!}}chart{{=}}Hot 100}}, because Billboard uses "Ke$ha" for the artist's name. That generates {{BillboardURLbyName|artist=Ke$ha|chart=Hot 100}}, while {{tlx|BillboardURLbyName|artist{{=}}Kesha{{!}}chart{{=}}Hot 100}} will generate {{BillboardURLbyName|artist=Kesha|chart=Hot 100}}. Because the artist name is case insensitive, other strings that will work include "[{{BillboardURLbyName|artist=KE$HA|chart=Hot 100}} KE$HA]", "[{{BillboardURLbyName|artist=ke$ha|chart=Hot 100}} ke$ha]" and even "[{{BillboardURLbyName|artist=kE$hA|chart=Hot 100}} kE$hA]".
+
This template is normally used within citations, e.g.
  
This template is normally used within citations, i.e.
+
{{Markup
 +
|<nowiki>It reached no. 2 on the Billboard Modern Rock Tracks chart.<ref>{{cite web | url={{BillboardURLbyName|artist=the breeders|chart=alternative songs}} | title=The Breeders Chart History | accessdate=2007-07-31 | publisher=''[[Billboard (magazine)|Billboard]]''}}</ref></nowiki>
 +
|It reached no. 2 on the Billboard Alternative Songs chart.<ref>{{cite web | url={{BillboardURLbyName|artist=the breeders|chart=alternative songs}} | title=The Breeders Chart History | accessdate=2007-07-31 | publisher=''[[Billboard (magazine)|Billboard]]''}}</ref>
 +
}}
  
*<nowiki><ref>{{cite web |url={{BillboardURLbyName|artist=Jennifer Lopez|chart=Hot 100}}|title=Jennifer Lopez Album & Song Chart History|work=Billboard|accessdate=June 10, 2011}}</ref></nowiki><ref>{{cite web |url={{BillboardURLbyName|artist=Jennifer Lopez|chart=Hot 100}}|title=Jennifer Lopez Album & Song Chart History|work=Billboard|accessdate=June 10, 2011}}</ref>
+
{{reflist}}
*<nowiki><ref>[{{BillboardURLbyName|artist=Jennifer Lopez|chart=Hot 100}} Jennifer Lopez Album & Song Chart History]</ref></nowiki><ref>[{{BillboardURLbyName|artist=Jennifer Lopez|chart=Hot 100}} Jennifer Lopez Album & Song Chart History]</ref>
 
  
{{reflist}}
+
== Notes ==
 +
 
 +
The artist name used by Billboard may not match Wikipedia's naming. Be especially mindful of artists whose names contain special characters. For example, an article about a song by [[Pink (singer)|P!nk]] needs to use {{tlx|BillboardURLbyName|artist{{=}}pnk|chart{{=}}Hot 100}} to match Billboard's url scheme. Billboard is also inconsistent about the use of a leading "The" in a band's name. For this reason, it's usually a good idea to test any urls generated by this template before adding them to an article.
  
== Maintenance categories ==
+
==TemplateData==
This template will automatically categorize articles with invalid artist names in [[:Category:Articles using Billboard ID with invalid artist]]. An invalid artist name is one that the template is unable to find in the {{tl|BillboardID}} subtemplate corresponding to the first letter in that artist's name.
+
<templatedata>
 +
{
 +
"description": "Generates billboard.com URLs for the chart history of a given artist.",
 +
"params": {
 +
"artist": {
 +
"label": "Artist name",
 +
"description": "The name of the artist, as it appears in billboard.com URLs",
 +
"type": "string",
 +
"required": true,
 +
"example": "The White Stripes"
 +
},
 +
"chart": {
 +
"label": "Chart name",
 +
"description": "The name of the Billboard chart",
 +
"example": "Digital Albums",
 +
"type": "string",
 +
"suggested": true
 +
},
 +
"bio": {
 +
"description": "Deprecated. No effect.",
 +
"type": "string",
 +
"deprecated": true
 +
}
 +
}
 +
}
 +
</templatedata>
  
Articles with invalid chart names are placed in [[:Category:Articles using BillboardChartNum with invalid chart name]].
 
  
 
== See also ==
 
== See also ==

Revision as of 22:58, 4 February 2019

This template returns a billboard.com URL for an artist's history on a particular chart.

Examples

Script error: No such module "aligned table".

Usage

This template is normally used within citations, e.g.

Markup Renders as
It reached no. 2 on the Billboard Modern Rock Tracks chart.<ref>{{cite web | url={{BillboardURLbyName|artist=the breeders|chart=alternative songs}} | title=The Breeders Chart History | accessdate=2007-07-31 | publisher=''[[Billboard (magazine)|Billboard]]''}}</ref>

It reached no. 2 on the Billboard Alternative Songs chart.[1]

  1. "The Breeders Chart History". Billboard. Retrieved 2007-07-31. Italic or bold markup not allowed in: |publisher= (help)

Notes

The artist name used by Billboard may not match Wikipedia's naming. Be especially mindful of artists whose names contain special characters. For example, an article about a song by P!nk needs to use {{BillboardURLbyName|artist=pnk|chart=Hot 100}} to match Billboard's url scheme. Billboard is also inconsistent about the use of a leading "The" in a band's name. For this reason, it's usually a good idea to test any urls generated by this template before adding them to an article.

TemplateData

Generates billboard.com URLs for the chart history of a given artist.

Template parameters

ParameterDescriptionTypeStatus
Artist nameartist

The name of the artist, as it appears in billboard.com URLs

Example
The White Stripes
Stringrequired
Chart namechart

The name of the Billboard chart

Example
Digital Albums
Stringsuggested
Biobio

Deprecated. No effect.

Stringdeprecated


See also