0
  • Drupal 7, view 3 and field collection.
  • I have a custom content type with a field collection called personal detail.
  • Personal detail have 2 fields: name and contact.
  • Personal detail is zero to unlimited.

  • In view, I am able to display the values of 'name' field. The problem is there are multiple values for 'name' field. This caused me to have duplicated records (i.e. same node id appears more than once, because the 'name' field)

  • I only want to display the very first one value of 'name' field which is stored the order of a node.

Solution: In Go to field collection in view's relationship (right column)

There is a statement: The delta allows you to select which item in a multiple value field to key the relationship off of. Select "1" to use the first item, "2" for the second item, and so on. If you select "All", each item in the field will create a new row, which may appear to cause duplicates.

So select "1" will show the first fields.

1 Answer 1

5

This can be done by modifying the Multiple field settings of your name field:

  • Click on the "name" field in your view (to edit the settings of field)
  • Navigate to "Multiple field settings" (present just above "Style" settings)
  • Click on the checkbox: "Display all values in the same row"
  • Choose "Display type": Ordered list
  • Below display type, there is one field "Display": Replace "ALL" with 1
  • Save the settings and the view.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.