Difference between revisions of "Template:PrintAuthorsArrayLastNameCommaFirstName"

From Encyclopedia of Scientonomy
Jump to navigation Jump to search
Line 16: Line 16:
 
   -->{{#arrayunique:authorsArray}}<!-- remove duplicates and empty values
 
   -->{{#arrayunique:authorsArray}}<!-- remove duplicates and empty values
 
   -->{{#ifexpr: {{#arraysize:authorsArray}} < 4 <!--
 
   -->{{#ifexpr: {{#arraysize:authorsArray}} < 4 <!--
   -->|{{#arrayprint:authorsArray |;<nowiki> </nowiki>|@@@@|{{PrintAuthorLastNameCommaFirstName|author=@@@@}}|print=pretty }}<!-- less than four authors
+
   -->|{{#arrayprint:authorsArray |;&#32;|@@@@|{{PrintAuthorLastNameCommaFirstName|author=@@@@}}|print=pretty }}<!-- less than four authors
 
   -->|{{PrintAuthorLastNameCommaFirstName|author={{#arrayindex:authorsArray |0 }} }} ''et al''<!-- more than three authors
 
   -->|{{PrintAuthorLastNameCommaFirstName|author={{#arrayindex:authorsArray |0 }} }} ''et al''<!-- more than three authors
 
   -->}}<!--ifexpr
 
   -->}}<!--ifexpr
 
-->}}<!--if
 
-->}}<!--if
 
--></includeonly>
 
--></includeonly>

Revision as of 21:13, 16 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.