Difference between revisions of "Template:Discogs artist/doc"

From blackwiki
Jump to navigation Jump to search
imported>Hildeoc
m
 
(138 intermediate revisions by 28 users not shown)
Line 1: Line 1:
{{documentation subpage}}
+
{{Documentation subpage}}
 +
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
 +
{{Uses Wikidata|P1953}}
  
{{tl|{{BASEPAGENAME}}}} generates links to artist discographies at [[Discogs|Discogs.com]].
+
The {{tl|{{BASEPAGENAME}}}} template generates links to artist discographies at [[Discogs|Discogs.com]].
 
 
:''Other Discogs templates: '''[[Template:Discogs release]], [[Template:Discogs label]]'''''
 
  
 
== Usage ==
 
== Usage ==
 
'''Code:'''
 
'''Code:'''
 
<pre>
 
<pre>
{{Discogs artist | artist = urlcode | name = {{subst:PAGENAME}} }}
+
{{Discogs artist}}
 +
{{Discogs artist|discogs_string}}
 +
{{Discogs artist|artist=discogs_string}}
 +
{{Discogs artist|discogs_string|link_name}}
 +
{{Discogs artist|artist=discogs_string|name=link_name}}
 
</pre>
 
</pre>
'''Placement:'''
+
'''Note:''' This template has been changed to be more similar to {{tl|Rolldabeats}}. That template usually works without any arguments for simple page names, and now this one does as well. The main difference is not to use plus signs for spaces.
* This template is an external links template and should be placed in the "External links" section of a musical artist's page.
+
*For details on simple page names, see [[#What is a simple artist name?]] section.
 +
*For details on what's been changed, see [[#2011 changes and notes]] section.
  
 
== Instructions ==
 
== Instructions ==
# Find the appropriate artist at [http://www.discogs.com/ discogs.com].
+
If no artist ID is provided, then the first value from Wikidata will be used. If the Wikidata item does not have any {{Q|P1953}} data, or there is no Wikidata item for the article, then the article title will be used to generate a link.
# The page [[URL]] should look like <nowiki>http://www.discogs.com/artist/xxxxx</nowiki>, where "xxxxx" indicates the artist's name.
 
# Copy ONLY the name (be sure that you didn't copy the / right before it)
 
# Add to the external links section the text:
 
::<nowiki>{{discogs artist | artist = xxxxx | name = yyyyy }}</nowiki>
 
:Where "xxxxx" is the name you've copied and "yyyyy" is the name you would like to display.
 
  
==Example==
+
# Find the appropriate artist at [http://www.discogs.com discogs.com].
# Search for "[[The Postal Service]]" on [http://www.discogs.com/ discogs.com], and you will reach this page: [http://www.discogs.com/artist/Postal+Service,+The http://www.discogs.com/artist/Postal+Service,+The]
+
# Copy the ''artist name'' from the web page content, '''not''' the URL. If they have a suffix such as (2), then copy that as well. Copy only the artist name. Sometimes Discogs has a blue link before the name, do not copy that.
# Copy "Postal+Service,+The" and then write:
+
# Add the following or similar code (see above) to the external links section:
:<nowiki>{{Discogs artist | artist = Postal+Service,+The | name = The Postal Service}}</nowiki>
+
::<code><nowiki>{{discogs artist|xxxxx|link_name}}</nowiki></code>
 +
:Where "xxxxx" is the name you've copied and the link_name is the name you would like to display on the link. If the name you would like to display is different, use parameter 2 or named parameter "name". This template also provides legacy support for named parameter "artist" instead of parameter 1 (see section [[#Usage]] above) or omission of the parameters altogether for single-word artistnames in their own articles.
 +
 
 +
== Examples ==
 +
=== Main article on a simple artist name ===
 +
Most page names are simple. Try simple approach in preview mode and see if that works. If it doesn't, see [[#What is a simple artist name?]] section.
 +
# For use in the article "[[Bjørn Torske]]", search for "[[Bjørn Torske]]" on [http://www.discogs.com discogs.com], and you will reach this page: [http://www.discogs.com/artist/Bjørn+Torske http://www.discogs.com/artist/Bjørn+Torske]
 +
# Write:
 +
:<code><nowiki>{{Discogs artist}}</nowiki></code>
 
The result is:
 
The result is:
:: [http://www.discogs.com/artist/Postal+Service,+The The Postal Service] at [[Discogs]]
+
:: {{Discogs artist}} (which renders here with a link and linkname with name of the current page)
 +
:: {{Discogs artist|Bjørn Torske|Bjørn Torske}} (which renders on [[Bjørn Torske]] with a link and linkname with name of that page)
 +
 
 +
=== Main article on an artist ===
 +
# For use in the article "[[The Postal Service]]", search for "[[The Postal Service]]" on [http://www.discogs.com discogs.com], and you will reach this page: [http://www.discogs.com/artist/The+Postal+Service http://www.discogs.com/artist/The+Postal+Service]
 +
# Copy "The Postal Service" from the web page content ('''not''' the URL) and then write:
 +
:<code><nowiki>{{Discogs artist|The Postal Service}}</nowiki></code>
 +
Note that there should be no spaces between the | character and the string. Spaces are fine for the named arguments:
 +
:<code><nowiki>{{Discogs artist|artist=The Postal Service}}</nowiki></code>
 +
The result is:
 +
:: {{Discogs artist|The Postal Service}} (which renders here with the linkname of the current page)
 +
When you provide the appropriate second argument "name", you get:
 +
:: {{Discogs artist|The Postal Service|The Postal Service}} (which renders on [[The Postal Service]] with the link and linkname of the current page)
 +
 
 +
(Previously, for the definitive article artist names, Discogs used "Postal Service, The" with URL "http://www.discogs.com/artist/Postal+Service,+The" naming scheme, but this has since been changed to the correct English language grammar.)
 +
 
 +
=== Article related to an artist ===
 +
# For use in an article related to "[[The Postal Service]]", search for "[[The Postal Service]]" on [http://www.discogs.com discogs.com], and you will reach this page: [http://www.discogs.com/artist/The+Postal+Service http://www.discogs.com/artist/The+Postal+Service]
 +
# Copy "The Postal Service" from the web page content ('''not''' the URL), and then write:
 +
:<code><nowiki>{{Discogs artist|The Postal Service|The Postal Service}}</nowiki></code>
 +
Again, the named arguments version is
 +
:<code><nowiki>{{Discogs artist|artist=The Postal Service|name=The Postal Service}}</nowiki></code>
 +
The result is:
 +
:: {{Discogs artist|artist=The Postal Service|name=The Postal Service}}
 +
 
 +
(Previously, for the definitive article artist names, Discogs used "Postal Service, The" with URL "http://www.discogs.com/artist/Postal+Service,+The" naming scheme, but this has since been changed to the correct English language grammar.)
 +
 
 +
== Usage note ==
 +
This template is an external links template and should be placed in the "External links" section of a musical artist's page. You should add a ''*'' before the template text to include it as a list item.
 +
 
 +
== What is a simple artist name? ==
 +
Briefly, a simple artist name is an article's PAGENAME that, short of upper/lowercase issues, exactly matches what Discogs uses. For example, for [[Kari Wührer]] they spell her name Kari Wuhrer without the umlaut, so it's not a match. In MediaWiki there are several characters that make pagenames not simple. Among these are ampersand, single quote and double quote (& ' "). (For details, see [[mw:Help:Magic_words#Page_names|here]] and [[mw:Manual:Page_title|there]]).
 +
 
 +
Both Wikipedia and Discogs add suffixes onto their names, but in different styles.
 +
:'''Wikipedia:'''
 +
* Wikipedia pages have suffixes such as "(band)" or "(musician)" which obviously will not match with Discogs.
 +
* Sometimes our pagename is fastidious, like the duo [[Morrissey–Mullen]] (with our use of [[MOS:DASH|en dash]]), Allmusic calling them "Morrissey & Mullen" and Discogs simply "Morrissey Mullen".
 +
* We also have a lot of separate pages with a suffix of "discography" for major artists where you will want to provide both parameters to get them to match and to look correctly, because this template says "discography" too, and the page should not say it twice.
 +
:'''Discogs:'''
 +
* Discogs always puts the "The" at the end of the band name, such as "Beatles, The" for [[The Beatles]]. That might at first seem excessive, but it helps them when sorting names and we do the same for our categories.
 +
* Discogs adds a suffix of a number in parenthesis such as (2) or (3) or more onto duplicate names. An example of mismatch in both cases is where what we call [[Kaleidoscope (UK band)]], that web site calls [http://www.discogs.com/artist/Kaleidoscope+(2) Kaleidoscope (2)] or the ''much'' too common name [[Blue (Scottish band)]] and [http://www.discogs.com/artist/Blue+(31) Blue (31)].
 +
* Sometimes Discogs only uses a first name, whilst we use the whole name.
 +
:'''Either:'''
 +
* Sometimes we do not space the same. Wikipedia has [[H. P. Baxxter]] with a space between the initials and they do not have a space there.
 +
 
 +
== 2011 changes and notes ==
 +
The template has been changed. Technically, it is now using [[Percent-encoding|URL encoding]] in the template (by means of <code>{{[[mw:Help:Magic_words#URL_data|urlencode]]}}</code>), we have to remove all plus signs. This task is about 80% complete. So far, we are only able to process the first two plus signs. That means that we still need to finish updating all the pages with page names longer than three words and remove the plus signs from the artist parameters. If this template does not work anymore on your favorite articles, then edit the usage and remove the plus signs "+", replacing them with spaces. If there is URL encoding (using percent signs "%" and hexnum hexnum), then change them back to the special characters they correspond to. The <code><nowiki>{{urlencode}}</nowiki></code> is now done within the template code and should not be done in the parameters. Pagenames that have special characters such as ampersand, single or double quote, [[En dash|en]] or [[Em dash|em]] dashes, or peculiar characters that we sometimes use might still require explicit parameters, but in ''many'' more cases you can just use the simple, no-parameter notation when calling this template.
 +
 
 +
When using the "no parameter" style, one will have to check after any sort of Wikipedia page rename and then update the template parameters accordingly. The same applies to translations in non-English-language wikis, such as Russian or Asian, that may use a mix of Western and native languages in their page names for Western artists, or [[Transliteration|transliterate]] the artist name.
 +
 
 +
Here is an example of some plain URLs that work properly:
 +
* http://discogs.com/artist/Ronski+Speed
 +
* http://discogs.com/artist/Ronski%20Speed
 +
 
 +
As a last example, we will have a plain, readable argument such as this for [[Girls' Generation]] in Korean:
 +
:<code><nowiki>{{Discogs artist|artist=소녀시대|name=소녀시대}}</nowiki></code>
 +
The result is:
 +
:: {{Discogs artist|artist=소녀시대|name=소녀시대}}
 +
The previous design forced editors to diddle with URL encoding and often turned readable identifiers into opaque. After all, what Wikipedia editor really wants to look at this opaque string or to change a space to a plus there?
 +
* http://www.discogs.com/artist/%EC%86%8C%EB%85%80%EC%8B%9C%EB%8C%80
 +
Those strings are indeed database keys but they're not an id or a number, and they were not designed to be opaque. With this change, we are now close to truly multilingual support just like some other templates already are.
 +
 
 +
As of early 2011, there are a half-dozen foreign wikis that have imported this template. Only the German wiki has not yet completely applied this "URL encoding in the template" update.
  
Note that, since this will almost certainly go on the external link section, you should add a ''*'' before the template text to include it as a list item.
+
== See also ==
 +
* {{tl|Discogs label}}
 +
* {{tl|Discogs master}}
 +
* {{tl|Discogs release}}
  
<includeonly>
+
<includeonly>{{Sandbox other||
<!-- categories and interwiki links -->
+
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Music external link templates|{{PAGENAME}}]]
+
[[Category:Music external link templates]]
[[ja:Template:Discogs artist]]
+
[[Category:People and person external link templates]]
[[nl:Sjabloon:Discogs artist]]
+
}}</includeonly>
[[ru:Шаблон:Discogs artist]]
 
</includeonly>
 

Latest revision as of 08:35, 26 August 2020

Template:Uses Wikidata

The {{Discogs artist}} template generates links to artist discographies at Discogs.com.

Usage

Code:

{{Discogs artist}}
{{Discogs artist|discogs_string}}
{{Discogs artist|artist=discogs_string}}
{{Discogs artist|discogs_string|link_name}}
{{Discogs artist|artist=discogs_string|name=link_name}}

Note: This template has been changed to be more similar to {{Rolldabeats}}. That template usually works without any arguments for simple page names, and now this one does as well. The main difference is not to use plus signs for spaces.

Instructions

If no artist ID is provided, then the first value from Wikidata will be used. If the Wikidata item does not have any Lua error in Module:Wd at line 196: attempt to index field 'wikibase' (a nil value). (P1953) data, or there is no Wikidata item for the article, then the article title will be used to generate a link.

  1. Find the appropriate artist at discogs.com.
  2. Copy the artist name from the web page content, not the URL. If they have a suffix such as (2), then copy that as well. Copy only the artist name. Sometimes Discogs has a blue link before the name, do not copy that.
  3. Add the following or similar code (see above) to the external links section:
{{discogs artist|xxxxx|link_name}}
Where "xxxxx" is the name you've copied and the link_name is the name you would like to display on the link. If the name you would like to display is different, use parameter 2 or named parameter "name". This template also provides legacy support for named parameter "artist" instead of parameter 1 (see section #Usage above) or omission of the parameters altogether for single-word artistnames in their own articles.

Examples

Main article on a simple artist name

Most page names are simple. Try simple approach in preview mode and see if that works. If it doesn't, see #What is a simple artist name? section.

  1. For use in the article "Bjørn Torske", search for "Bjørn Torske" on discogs.com, and you will reach this page: http://www.discogs.com/artist/Bjørn+Torske
  2. Write:
{{Discogs artist}}

The result is:

Template:Wikidata Template:PAGENAMEBASE discography at DiscogsScript error: No such module "EditAtWikidata". (which renders here with a link and linkname with name of the current page)
Bjørn Torske discography at Discogs (which renders on Bjørn Torske with a link and linkname with name of that page)

Main article on an artist

  1. For use in the article "The Postal Service", search for "The Postal Service" on discogs.com, and you will reach this page: http://www.discogs.com/artist/The+Postal+Service
  2. Copy "The Postal Service" from the web page content (not the URL) and then write:
{{Discogs artist|The Postal Service}}

Note that there should be no spaces between the | character and the string. Spaces are fine for the named arguments:

{{Discogs artist|artist=The Postal Service}}

The result is:

Template:PAGENAMEBASE discography at Discogs (which renders here with the linkname of the current page)

When you provide the appropriate second argument "name", you get:

The Postal Service discography at Discogs (which renders on The Postal Service with the link and linkname of the current page)

(Previously, for the definitive article artist names, Discogs used "Postal Service, The" with URL "http://www.discogs.com/artist/Postal+Service,+The" naming scheme, but this has since been changed to the correct English language grammar.)

Article related to an artist

  1. For use in an article related to "The Postal Service", search for "The Postal Service" on discogs.com, and you will reach this page: http://www.discogs.com/artist/The+Postal+Service
  2. Copy "The Postal Service" from the web page content (not the URL), and then write:
{{Discogs artist|The Postal Service|The Postal Service}}

Again, the named arguments version is

{{Discogs artist|artist=The Postal Service|name=The Postal Service}}

The result is:

The Postal Service discography at Discogs

(Previously, for the definitive article artist names, Discogs used "Postal Service, The" with URL "http://www.discogs.com/artist/Postal+Service,+The" naming scheme, but this has since been changed to the correct English language grammar.)

Usage note

This template is an external links template and should be placed in the "External links" section of a musical artist's page. You should add a * before the template text to include it as a list item.

What is a simple artist name?

Briefly, a simple artist name is an article's PAGENAME that, short of upper/lowercase issues, exactly matches what Discogs uses. For example, for Kari Wührer they spell her name Kari Wuhrer without the umlaut, so it's not a match. In MediaWiki there are several characters that make pagenames not simple. Among these are ampersand, single quote and double quote (& ' "). (For details, see here and there).

Both Wikipedia and Discogs add suffixes onto their names, but in different styles.

Wikipedia:
  • Wikipedia pages have suffixes such as "(band)" or "(musician)" which obviously will not match with Discogs.
  • Sometimes our pagename is fastidious, like the duo Morrissey–Mullen (with our use of en dash), Allmusic calling them "Morrissey & Mullen" and Discogs simply "Morrissey Mullen".
  • We also have a lot of separate pages with a suffix of "discography" for major artists where you will want to provide both parameters to get them to match and to look correctly, because this template says "discography" too, and the page should not say it twice.
Discogs:
  • Discogs always puts the "The" at the end of the band name, such as "Beatles, The" for The Beatles. That might at first seem excessive, but it helps them when sorting names and we do the same for our categories.
  • Discogs adds a suffix of a number in parenthesis such as (2) or (3) or more onto duplicate names. An example of mismatch in both cases is where what we call Kaleidoscope (UK band), that web site calls Kaleidoscope (2) or the much too common name Blue (Scottish band) and Blue (31).
  • Sometimes Discogs only uses a first name, whilst we use the whole name.
Either:
  • Sometimes we do not space the same. Wikipedia has H. P. Baxxter with a space between the initials and they do not have a space there.

2011 changes and notes

The template has been changed. Technically, it is now using URL encoding in the template (by means of {{urlencode}}), we have to remove all plus signs. This task is about 80% complete. So far, we are only able to process the first two plus signs. That means that we still need to finish updating all the pages with page names longer than three words and remove the plus signs from the artist parameters. If this template does not work anymore on your favorite articles, then edit the usage and remove the plus signs "+", replacing them with spaces. If there is URL encoding (using percent signs "%" and hexnum hexnum), then change them back to the special characters they correspond to. The {{urlencode}} is now done within the template code and should not be done in the parameters. Pagenames that have special characters such as ampersand, single or double quote, en or em dashes, or peculiar characters that we sometimes use might still require explicit parameters, but in many more cases you can just use the simple, no-parameter notation when calling this template.

When using the "no parameter" style, one will have to check after any sort of Wikipedia page rename and then update the template parameters accordingly. The same applies to translations in non-English-language wikis, such as Russian or Asian, that may use a mix of Western and native languages in their page names for Western artists, or transliterate the artist name.

Here is an example of some plain URLs that work properly:

As a last example, we will have a plain, readable argument such as this for Girls' Generation in Korean:

{{Discogs artist|artist=소녀시대|name=소녀시대}}

The result is:

소녀시대 discography at Discogs

The previous design forced editors to diddle with URL encoding and often turned readable identifiers into opaque. After all, what Wikipedia editor really wants to look at this opaque string or to change a space to a plus there?

Those strings are indeed database keys but they're not an id or a number, and they were not designed to be opaque. With this change, we are now close to truly multilingual support just like some other templates already are.

As of early 2011, there are a half-dozen foreign wikis that have imported this template. Only the German wiki has not yet completely applied this "URL encoding in the template" update.

See also