Open main menu

Changes

Template:AllMusic

2,366 bytes added, 15:08, 13 August 2018
If parameter 1 or "class" not specified, default "class" is based on "id" (mn=artist, mw=album, mt=song, mc=composition). If not using "pure_url" and "id" not specified, either use Wikidata property or display error message. Update handling of empty parameters. Trim leading and trailing spaces where needed. All first tested with /sandbox and /testcases. See talk page for full details.
{{#ifeq: {{{pure_url|}}} | yes
| https://www.allmusic.com/{{{class|{{Trim|{{{1|{{
#switch:{{padleft:|2|{{#invoke:String|replace|source={{{id|{{Trim|{{{2|}}}}}}}}|pattern=.*-|replace=|plain=false}}}}
| mn = artist
| mw = album
| mt = song
| mc = composition
| artist
}}}}}}}}}}/{{{id|{{Trim|{{{2|}}}}}}}}{{
#if: {{{tab|}}}
| /{{{tab}}}
}}

| {{#if: {{{2|{{{id<includeonly>|</includeonly>}}}}}}
| {{#if: {{{last|{{{author|}}}}}}
| {{{last|{{{author|}}}}}}{{#if: {{{first|}}}|, {{{first}}} }}.&#32;
}}[https://www.allmusic.com/{{{class|{{Trim|{{{1|{{
#switch:{{padleft:|2|{{#invoke:String|replace|source={{{id|{{Trim|{{{2|}}}}}}}}|pattern=.*-|replace=|plain=false}}}}
| mn = artist
| mw = album
| mt = song
| mc = composition
| artist
}}}}}}}}}}/{{{id|{{Trim|{{{2|}}}}}}}}{{
#if: {{{tab|}}}
| /{{{tab}}}
}} {{
#if: {{{3|{{{label|{{{title|}}}}}}}}}
| {{{3|{{{label|{{{title}}}}}}}}}
| {{PAGENAMEBASE}}
}}] at [[AllMusic]]{{
#if: {{{accessdate|}}}
| . Retrieved {{{accessdate}}}.
}}

| {{#if: {{#property:P1728}}
| [https://www.allmusic.com/artist/{{First word|1={{#property:P1728}}|sep=,}} {{#if: {{{label|{{{title|}}}}}} | {{{label|{{{title}}}}}} | {{PAGENAMEBASE}} }}] at [[AllMusic]]{{EditAtWikidata|pid=P1728}}

| {{#if: {{#property:P1729}}
| [https://www.allmusic.com/album/{{First word|1={{#property:P1729}}|sep=,}} {{#if: {{{label|{{{title|}}}}}} | {{{label|{{{title}}}}}} | {{PAGENAMEBASE}} }}] at [[AllMusic]]{{EditAtWikidata|pid=P1729}}

| {{#if: {{#property:P1730}}
| [https://www.allmusic.com/song/{{First word|1={{#property:P1730}}|sep=,}} {{#if: {{{label|{{{title|}}}}}} | {{{label|{{{title}}}}}} | {{PAGENAMEBASE}} }}] at [[AllMusic]]{{EditAtWikidata|pid=P1730}}

| {{#if: {{#property:P1994}}
| [https://www.allmusic.com/composition/{{First word|1={{#property:P1994}}|sep=,}} {{#if: {{{label|{{{title|}}}}}} | {{{label|{{{title}}}}}} | {{PAGENAMEBASE}} }}] at [[AllMusic]]{{EditAtWikidata|pid=P1994}}

| <span class="error">&#123;&#123;[[Template:AllMusic|AllMusic]]&#125;&#125; template missing ID and not present in Wikidata.</span>{{Main other|[[Category:AllMusic template missing ID and not in Wikidata]]}}

}}
}}
}}
}}
}}
}}<noinclude>{{Documentation}}</noinclude>
Anonymous user