Difference between revisions of "Template:AllMusic/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>GermanJoe
(+ TD header)
blackwiki>Zyxw
(fix examples with non-working links, show URL generated, show short and long form ID, remove redundant parameter descriptions which are now available in the TemplateData section)
Line 1: Line 1:
{{documentation subpage}}
+
{{Documentation subpage}}
 
+
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
=== Purpose ===
 
 
This template provides a convenient way to produce an external link to an entry at [[AllMusic]]. The template can be used for any link to AllMusic's website, including the ''External links'' section or when citing it as a source.
 
This template provides a convenient way to produce an external link to an entry at [[AllMusic]]. The template can be used for any link to AllMusic's website, including the ''External links'' section or when citing it as a source.
  
=== Usage ===
+
== Usage ==
'''Vertical layout'''
+
=== Vertical layout ===
 
<pre>
 
<pre>
 
{{Allmusic
 
{{Allmusic
| class      =
+
| class      =  
| id        =
+
| id        =  
| tab        =
+
| tab        =  
| label      =
+
| label      =  
| first      =
+
| first      =  
| last      =
+
| last      =  
| accessdate =
+
| accessdate =  
 
}}
 
}}
 
</pre>
 
</pre>
  
'''Horizontal layout'''
+
=== Horizontal layout (named parameters) ===
<pre>{{Allmusic |class= |id= |tab= |label= |first= |last= |accessdate= }}</pre>
+
<pre>{{Allmusic | class= | id= | tab= | label= | first= | last= | accessdate= }}</pre>
  
'''Short layout'''
+
=== Horizontal layout (unnamed parameters) ===
 
Valid with these three parameters only:
 
Valid with these three parameters only:
 
<pre>{{Allmusic|<class>|<id>|<label>}}</pre>
 
<pre>{{Allmusic|<class>|<id>|<label>}}</pre>
  
=== Parameters ===
+
== Template data ==
{| border="1" class="wikitable sortable"
+
{{TemplateDataHeader}}
|- style="background-color:#f2f2f4"
+
<templatedata>
! Parameter
+
{
! class="unsortable" style="width:100px" | Type
+
    "description": "This template produces an external link to an entry at AllMusic.",
! class="unsortable"|Description
+
    "params": {
|-
+
        "class": {
| '''class'''
+
            "label": "AllMusic class",
| optional
+
            "aliases": ["1"],
| Class of information, possible are "artist", "album", "song", "work" or "explore". Value for this parameter corresponds to part of [[Uniform resource locator|URL]] following "www.allmusic.com/". If omitted, it defaults to "artist".
+
            "type": "string",
|-
+
            "default": "artist",
| '''id'''
+
            "description": "Class of information. Value for this parameter corresponds to part of URL following \"www.allmusic.com/\". Examples (without quotes): \"artist\" (default), \"album\", \"song\", \"work\" or \"explore\"."
| '''mandatory'''
+
        },
| Identification of information. Corresponds to part of URL following "artist/", "album/", "song/", "work/" or "explore/". The text before the actual id with name of artist, album etc. can be omitted. (Example: For [http://www.allmusic.com/artist/led-zeppelin-p4739 www.allmusic.com/artist/led-zeppelin-p4739] "p4739" is sufficient for id).
+
        "id": {
|-
+
            "label": "AllMusic ID",
| '''tab'''
+
            "aliases": ["2"],
| optional
+
            "type": "string",
| If the link should access directly a specific tab on the AllMusic site you can use this parameter to specify that tab (e.g. "charts-awards"). The value for this parameter corresponds to the suffix of the URL following the identification, after the slash ('/'). If you are specifying a sub-tab of a tab, the whole suffix has to be used, (e.g. "songs/songs-composed-by"). Alternatively you can append the whole suffix for tab to the id parameter not using the tab parameter (see example below).
+
            "required": true,
|-
+
            "description": "AllMusic identification number or string. Corresponds to part of URL following \"artist/\", \"album/\", \"song/\", \"work/\" or \"explore/\". Can omit the text before the actual ID with name of artist, album, etc. Example: The ID for www.allmusic.com/artist/led-zeppelin-mn0000139026 would be either \"led-zeppelin-mn0000139026\" or \"mn0000139026\". Can also use the entire end of URL, such as: \"release/stone-temple-pilots-deluxe-edition-mr0002917004\"."
| '''label'''
+
        },
| optional
+
        "tab": {
| Label to display for the link. If omitted, it defaults to the name of the article where this template is used.
+
            "label": "AllMusic tab",
|-
+
            "type": "string",
| '''first'''
+
            "description": "If the link should access directly a specific tab on the AllMusic site you can use this parameter to specify that tab. The value for this parameter corresponds to the suffix of the URL following the identification, after the slash ('/'). Examples (without quotes): \"biography\", \"discography\", \"songs\", \"awards\", etc. If you are specifying a sub-tab of a tab, the whole suffix has to be used, (e.g. \"songs/all\")."
| optional
+
        },
| The author's first or given name(s).
+
        "label": {
|-
+
            "label": "Displayed text",
| '''last'''
+
            "aliases": ["3", "title"],
| optional
+
            "type": "string",
| The author's surname or last name.
+
            "description": "Text to display for the link. If omitted, it defaults to the name of the article where this template is used."
|-
+
        },
| '''pure_url'''
+
        "first": {
| optional
+
            "label": "Author's first name",
| Value of "yes" produces no label and no additional text but a "pure" standalone external link. This option is mainly intended for the automated migration of standalone weblinks but can be used when linking to allmusic using {{tl|Cite web}}, embedding <nowiki>{{Allmusic}}</nowiki> in {{tl|Cite web}}. E.g.<br />
+
            "type": "string",
<code><nowiki>{{cite web|url={{Allmusic |pure_url=yes |class=album |id=r1796665 |tab=review}} |title=Stone Temple Pilots [Deluxe Edition] |first=Stephen Thomas |last=Erlewine}}</nowiki></code><br />
+
            "description": "The author's first or given name(s)."
produces:<br />
+
        },
*{{cite web|url={{Allmusic |pure_url=yes |class=album |id=r1796665 |tab=review}} |title=Stone Temple Pilots [Deluxe Edition] |first=Stephen Thomas |last=Erlewine}}
+
        "last": {
|-
+
            "label": "Author's last name",
| '''accessdate'''
+
            "type": "string",
| optional
+
            "description": "The author's surname or last name."
| Full date when item was accessed. Should not be wikilinked.
+
        },
|}
+
        "accessdate": {
 +
            "label": "Access date",
 +
            "type": "string",
 +
            "description": "Full date when item was accessed. Should not be wiki-linked."
 +
        },
 +
        "pure_url": {
 +
            "label": "URL only",
 +
            "type": "string",
 +
            "description": "If set to \"yes\", produces URL only without additional formatting. Typically used in citation templates."
 +
        }
 +
    }
 +
}
 +
</templatedata>
 +
 
 +
== Examples ==
 +
=== Artist or group (class not specified, defaults to artist) ===
 +
 
 +
Full ID:
 +
* Code:  <code><nowiki>{{Allmusic | id= led-zeppelin-mn0000139026 | label= Led Zeppelin}}</nowiki></code>
 +
* Output: {{Allmusic | id= led-zeppelin-mn0000139026 | label= Led Zeppelin}}
 +
* URL:    {{Allmusic | id= led-zeppelin-mn0000139026 | pure_url= yes}}
 +
 
 +
Short ID:
 +
* Code:  <code><nowiki>{{Allmusic | id= mn0000139026 | label= Led Zeppelin}}</nowiki></code>
 +
* Output: {{Allmusic | id= mn0000139026 | label= Led Zeppelin}}
 +
* URL:    {{Allmusic | id= mn0000139026 | pure_url= yes}}
 +
 
 +
=== Album (with accessdate) ===
 +
 
 +
Full ID:
 +
* Code:  <code><nowiki>{{Allmusic | class= album | id= news-of-the-world-mw0000191493 | label= ''News of the World'' | accessdate= March 30, 2014}}</nowiki></code>
 +
* Output: {{Allmusic | class= album | id= news-of-the-world-mw0000191493 | label= ''News of the World'' | accessdate= March 30, 2014}}
 +
* URL:    {{Allmusic | class= album | id= news-of-the-world-mw0000191493 | pure_url= yes}}
 +
 
 +
Short ID:
 +
* Code:  <code><nowiki>{{Allmusic | class= album | id= mw0000191493 | label= ''News of the World'' | accessdate= March 30, 2014}}</nowiki></code>
 +
* Output: {{Allmusic | class= album | id= mw0000191493 | label= ''News of the World'' | accessdate= March 30, 2014}}
 +
* URL:    {{Allmusic | class= album | id= mw0000191493 | pure_url= yes}}
 +
 
 +
=== Song (with unnamed parameters) ===
 +
 
 +
Full ID:
 +
* Code:  <code><nowiki>{{Allmusic | song | dust-in-the-wind-mt0013834783 | "Dust in the Wind"}}</nowiki></code>
 +
* Output: {{Allmusic | song | dust-in-the-wind-mt0013834783 | "Dust in the Wind"}}
 +
* URL:    {{Allmusic | song | dust-in-the-wind-mt0013834783 | pure_url= yes}}
 +
 
 +
Short ID:
 +
* Code:  <code><nowiki>{{Allmusic | song | mt0013834783 | "Dust in the Wind"}}</nowiki></code>
 +
* Output: {{Allmusic | song | mt0013834783 | "Dust in the Wind"}}
 +
* URL:    {{Allmusic | song | mt0013834783 | pure_url= yes}}
  
=== Examples ===
+
=== Using tab parameter ===
'''Group or artist'''
 
*<code><nowiki>{{Allmusic|id=p4739|label=Led Zeppelin}}</nowiki></code>
 
expands to
 
*{{Allmusic|id=p4739|label=Led Zeppelin}}
 
  
'''Album (supplying accessdate)'''
+
Full ID:
*<code><nowiki>{{Allmusic|class=album|id=r15973|label=''News of the World''|accessdate=February 10, 2010}}</nowiki></code>
+
* Code:  <code><nowiki>{{Allmusic | id= led-zeppelin-mn0000139026 | tab= discography | label= Led Zeppelin discography}}</nowiki></code>
expands to
+
* Output: {{Allmusic | id= led-zeppelin-mn0000139026 | tab= discography | label= Led Zeppelin discography}}
*{{Allmusic|class=album|id=r15973|label=''News of the World''|accessdate=February 10, 2010}}
+
* URL:    {{Allmusic | id= led-zeppelin-mn0000139026 | tab= discography | pure_url= yes}}
  
'''Song (short notation)'''
+
Short ID:
*<code><nowiki>{{Allmusic|song|t2454936|"Dust in the Wind"}}</nowiki></code>
+
* Code:  <code><nowiki>{{Allmusic | id= mn0000139026 | tab= discography | label= Discography of Led Zeppelin}}</nowiki></code>
expands to
+
* Output: {{Allmusic | id= mn0000139026 | tab= discography | label= Discography of Led Zeppelin}}
*{{Allmusic|song|t2454936|"Dust in the Wind"}}
+
* URL:    {{Allmusic | id= mn0000139026 | tab= discography | pure_url= yes}}
  
'''Using tab parameter'''
+
=== Author name, access date ===
*<code><nowiki>{{Allmusic|id=p4739|tab=discography|label=Discography of Led Zeppelin}}</nowiki></code>
 
expands to
 
*{{Allmusic|id=p4739|tab=discography|label=Discography of Led Zeppelin}}
 
  
'''Accessing tab in tab with sort (not using tab parameter)'''
+
Full ID:
*<code><nowiki>{{Allmusic|id=p4739/discography/compilations/title-asc|label=Compilations of Led Zeppelin sorted by title}}</nowiki></code>
+
* Code:  <code><nowiki>{{Allmusic | class= album | id= physical-graffiti-mw0000190771 | title= Review of ''Physical Graffiti'' | first= Stephen Thomas | last= Erlewine | accessdate= March 30, 2014}}</nowiki></code>
expands to
+
* Output: {{Allmusic | class= album | id= physical-graffiti-mw0000190771 | title= Review of ''Physical Graffiti'' | first= Stephen Thomas | last= Erlewine | accessdate= March 30, 2014}}
*{{Allmusic|id=p4739/discography/compilations/title-asc|label=Compilations of Led Zeppelin sorted by title}}
+
* URL:    {{Allmusic | class= album | id= physical-graffiti-mw0000190771 | pure_url= yes}}
  
'''Author name'''
+
Short ID:
*<code><nowiki>{{Allmusic|class=album|id=r11465|label=Physical Graffiti|first=Stephen Thomas|last=Erlewine|accessdate=February 10, 2010}}</nowiki></code>
+
* Code:  <code><nowiki>{{Allmusic | class= album | id= mw0000190771 | title= Review of ''Physical Graffiti'' | first= Stephen Thomas | last= Erlewine | accessdate= March 30, 2014}}</nowiki></code>
expands to
+
* Output: {{Allmusic | class= album | id= mw0000190771 | title= Review of ''Physical Graffiti'' | first= Stephen Thomas | last= Erlewine | accessdate= March 30, 2014}}
*{{Allmusic|class=album|id=r11465|label=Physical Graffiti|first=Stephen Thomas|last=Erlewine|accessdate=February 10, 2010}}
+
* URL:    {{Allmusic | class= album | id= mw0000190771 | pure_url= yes}}
  
=== Template data ===
+
=== Using ''pure_url'' with a citation template ===
{{TemplateDataHeader}}
+
 
<templatedata>
+
* Code:  <code><nowiki>{{cite web | url = {{Allmusic|album|mw0000190771|pure_url=yes}} | title = Review of ''Physical Graffiti'' | work = [[AllMusic]] | publisher = [[All Media Guide]] | first = Stephen Thomas | last = Erlewine | accessdate = March 30, 2014}}</nowiki></code><br />
{
+
* Output: {{cite web | url = {{Allmusic|album|mw0000190771|pure_url=yes}} | title = Review of ''Physical Graffiti'' | work = [[AllMusic]] | publisher = [[All Media Guide]] | first = Stephen Thomas | last = Erlewine | accessdate = March 30, 2014}}
"description": "This template produces an external link to an entry at AllMusic.",
+
* URL:   {{Allmusic|album|mw0000190771|pure_url=yes}}
"params": {
+
 
"class": {
+
== See also ==
"label": "AllMusic class",
+
* {{tl|AllMovie movie}}
"type": "string",
+
* {{tl|AllMovie person}}
"description": "Class of information, possible are \"artist\" (default), \"album\", \"song\", \"work\" or \"explore\". Part of URL immediately after \"www.allmusic.com/\".",
+
* {{tl|AllGame}}
"aliases":["1"]
 
},
 
"id": {
 
"label": "AllMusic ID",
 
"type": "number",
 
"required": true,
 
"description": "AllMusic ID number. The letter-number code towards the end of the URL. Can be used for the entire end of the URL.",
 
"aliases":["2"]
 
},
 
"tab": {
 
"label": "Page tab",
 
"type": "string",
 
"description": "If the link should access directly a specific tab on the AllMusic site you can use this parameter to specify that tab (e.g. \"charts-awards\"). The value for this parameter corresponds to the suffix of the URL following the identification, after the slash ('/'). If you are specifying a sub-tab of a tab, the whole suffix has to be used, (e.g. \"songs/songs-composed-by\")."
 
},
 
"label": {
 
"label": "Displayed text",
 
"type": "string",
 
"description": "Text to display for the link. Defaults to page title.",
 
"aliases":["3"]
 
},
 
"first": {
 
"label": "Author's first name",
 
"type": "string",
 
"description": "The author's first or given name(s)."
 
},
 
"last": {
 
"label": "Author's last name",
 
"type": "string",
 
"description": "The author's surname or last name."
 
},
 
"pure_url": {
 
"label": "URL only",
 
"type": "string",
 
"description": "If set to \"yes\", produces URL only without additional formatting. Typically used in citation templates."
 
},
 
"accessdate": {
 
"label": "Access date",
 
"type": "string",
 
"description": "Full date when item was accessed."
 
}
 
}
 
}
 
</templatedata>
 
  
<includeonly>
+
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- ADD CATEGORIES BELOW THIS LINE -->
+
<!-- Categories go here and interwikis go in Wikidata. -->
 
[[Category:Music external link templates]]
 
[[Category:Music external link templates]]
 
[[Category:Music source templates]]
 
[[Category:Music source templates]]
 
[[Category:WikiProject Albums templates]]
 
[[Category:WikiProject Albums templates]]
<!-- ADD INTERWIKIS BELOW THIS LINE -->
+
}}</includeonly>
</includeonly>
 

Revision as of 01:50, 31 March 2014

This template provides a convenient way to produce an external link to an entry at AllMusic. The template can be used for any link to AllMusic's website, including the External links section or when citing it as a source.

Usage

Vertical layout

{{Allmusic
| class      = 
| id         = 
| tab        = 
| label      = 
| first      = 
| last       = 
| accessdate = 
}}

Horizontal layout (named parameters)

{{Allmusic | class= | id= | tab= | label= | first= | last= | accessdate= }}

Horizontal layout (unnamed parameters)

Valid with these three parameters only:

{{Allmusic|<class>|<id>|<label>}}

Template data

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for AllMusic

This template produces an external link to an entry at AllMusic.

Template parameters

ParameterDescriptionTypeStatus
AllMusic classclass 1

Class of information. Value for this parameter corresponds to part of URL following "www.allmusic.com/". Examples (without quotes): "artist" (default), "album", "song", "work" or "explore".

Default
artist
Stringoptional
AllMusic IDid 2

AllMusic identification number or string. Corresponds to part of URL following "artist/", "album/", "song/", "work/" or "explore/". Can omit the text before the actual ID with name of artist, album, etc. Example: The ID for www.allmusic.com/artist/led-zeppelin-mn0000139026 would be either "led-zeppelin-mn0000139026" or "mn0000139026". Can also use the entire end of URL, such as: "release/stone-temple-pilots-deluxe-edition-mr0002917004".

Stringrequired
AllMusic tabtab

If the link should access directly a specific tab on the AllMusic site you can use this parameter to specify that tab. The value for this parameter corresponds to the suffix of the URL following the identification, after the slash ('/'). Examples (without quotes): "biography", "discography", "songs", "awards", etc. If you are specifying a sub-tab of a tab, the whole suffix has to be used, (e.g. "songs/all").

Stringoptional
Displayed textlabel 3 title

Text to display for the link. If omitted, it defaults to the name of the article where this template is used.

Stringoptional
Author's first namefirst

The author's first or given name(s).

Stringoptional
Author's last namelast

The author's surname or last name.

Stringoptional
Access dateaccessdate

Full date when item was accessed. Should not be wiki-linked.

Stringoptional
URL onlypure_url

If set to "yes", produces URL only without additional formatting. Typically used in citation templates.

Stringoptional

Examples

Artist or group (class not specified, defaults to artist)

Full ID:

Short ID:

Album (with accessdate)

Full ID:

Short ID:

Song (with unnamed parameters)

Full ID:

Short ID:

Using tab parameter

Full ID:

Short ID:

Author name, access date

Full ID:

Short ID:

Using pure_url with a citation template

  • Code: {{cite web | url = {{Allmusic|album|mw0000190771|pure_url=yes}} | title = Review of ''Physical Graffiti'' | work = [[AllMusic]] | publisher = [[All Media Guide]] | first = Stephen Thomas | last = Erlewine | accessdate = March 30, 2014}}
  • Output: Erlewine, Stephen Thomas. "Review of Physical Graffiti". AllMusic. All Media Guide. Retrieved March 30, 2014.
  • URL: https://www.allmusic.com/album/mw0000190771

See also