Difference between revisions of "Template:PrintAuthorsArrayLastNameCommaFirstName"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
This template is used to convert an array of author names like "Thomas Kuhn, Imre Lakatos, Larry Laudan" into "Kuhn, Thomas; Lakatos, Imre; Laudan, Larry". If there are more than three authors, the "Kuhn, Thomas ''et al.'' will be returned. | This template is used to convert an array of author names like "Thomas Kuhn, Imre Lakatos, Larry Laudan" into "Kuhn, Thomas; Lakatos, Imre; Laudan, Larry". If there are more than three authors, the "Kuhn, Thomas ''et al.'' will be returned. | ||
− | Parameters: | + | '''NOTE:''' As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page. |
+ | |||
+ | '''Parameters:''' | ||
* <code><nowiki>|authors=</nowiki></code> - a comma delimited list of authors. | * <code><nowiki>|authors=</nowiki></code> - a comma delimited list of authors. | ||
+ | * <code><nowiki>|intro=</nowiki></code> - if the results need to have a preceding text, write it here. | ||
</noinclude><includeonly><!-- | </noinclude><includeonly><!-- | ||
− | -->{{#if: {{{authors|}}}<!-- | + | -->{{#if: {{{authors|}}} |<!-- |
− | + | --><!-- add intro | |
+ | -->{{{intro|}}}<!-- | ||
+ | --><!-- add the authors | ||
+ | -->{{#arraydefine:authorsArray |{{{authors|}}} }}<!-- | ||
-->{{#arrayunique:authorsArray}}<!-- remove duplicates and empty values | -->{{#arrayunique:authorsArray}}<!-- remove duplicates and empty values | ||
-->{{#ifexpr: {{#arraysize:authorsArray}} < 4 <!-- | -->{{#ifexpr: {{#arraysize:authorsArray}} < 4 <!-- |
Revision as of 19:12, 13 August 2016
This template is used to convert an array of author names like "Thomas Kuhn, Imre Lakatos, Larry Laudan" into "Kuhn, Thomas; Lakatos, Imre; Laudan, Larry". If there are more than three authors, the "Kuhn, Thomas et al. will be returned.
NOTE: As any "printing" template, it doesn't store any values anywhere, but merely prints them on the page.
Parameters:
|authors=
- a comma delimited list of authors.|intro=
- if the results need to have a preceding text, write it here.