Iterate through authors as getting value directly only gets the first
Ref #108
This commit is contained in:
parent
1ab0ad4b3e
commit
f322a7c93a
1 changed files with 6 additions and 1 deletions
|
@ -75,7 +75,12 @@ function geo_citation_pseudo_field($entity) {
|
||||||
return $markup;
|
return $markup;
|
||||||
}
|
}
|
||||||
|
|
||||||
$authors = isset($entity->field_authors->entity) ? $entity->field_authors->entity->title->value : '';
|
$authors = '';
|
||||||
|
foreach ($entity->field_authors as $i => $author) {
|
||||||
|
// @TODO replace this with https://packagist.org/packages/agaric/oxford-comma
|
||||||
|
$authors .= ($i > 0) ? ', ' : '';
|
||||||
|
$authors .= isset($author->entity) ? $author->entity->title->value : '';
|
||||||
|
}
|
||||||
$date = $entity->field_publication_date->value;
|
$date = $entity->field_publication_date->value;
|
||||||
$year = substr($date, 0, 4);
|
$year = substr($date, 0, 4);
|
||||||
$title = $entity->title->value;
|
$title = $entity->title->value;
|
||||||
|
|
Loading…
Add table
Reference in a new issue