Rejoice, you can now assign more than one author to an entry!
Before you can use multiple authors, you need to change the “Max Authors” setting in the section settings to greater than 1 (default).
A user is only assignable as an author if the user has at least View Entries permission of the section where the entries are located. The best way to do this is to create one or more user groups with the appropriate permissions and assign users you want to be authors to those groups.
User do not need the control panel access permission in order to be included as an author.
To access the authors in Twig, you can do one of the following:
Loop over all authors:
{% for author in entry.authors %}
{{ author.fullName ?? author.username }} {# falling back to username #}
{% endfor %}
Map authors and join by comma:
{{ entry.authors | map(author => "#{author.fullname}" ?? "#{author.username}") | join(', ') }}
To get the entries by an author or authors:
{% set myEntries = craft.entries.authorId(1).all() %} {# return entries where one of the authors matches the passed in ID #}
or
{% set entries = craft.entries.authorsIds([1,2]) %} {# returns only entries with both authors #}
Craft CMS 5 Guide is made up of the following videos: