Citation suggestion for data set

In creating a block with a suggested citations I ran into a number of challenges.

  1. The creator/owner field is a referenced field with multiple persons possible.  I could get a list of names but it was hard to find a way to get a row of comma separated names.  I probably could have created a view mode with code but instead I found a module - views merge rows which will merge the rows into a row.  It already has a ver 8 so would be good for upgrating.
  2. I needed to reformat the names last, first initial.  Here I just need to make a custom name format.

So here are the steps:

  • Install module views merge rows via:  drush en views_merge_rows -y
  • Create a custom name format admin/config/regional/name  I called mine Citation with a format of  LG((f-,)+ (x-.)+ (y-.))
  • Create a block view which I called Data set citation.  filtered to data set,

Unformatted list with fields of:

Contextual filter on Node Id:

Relationship of Entity Reference on field_person_creator:

Configure field Name using the relationship:

Configure format of fields setting to Inline Fields

Configure format of fields setting to Inline Fields

Set the merge row

  • Once view is created then add a Display Suite block field using the view with layout "show only block content" called "Citation Suggestion".
  • Now create and enable a group field I called "group_citation" of format "Fieldset".  Edit the label to add a description like "Published on EDI/LTER Data Portal". 
  • Enable the block field "Citation Suggestion" and place under the group_citation