1

I have the following content types in Drupal 8 :

User

  • field: image
  • other fields

Organization

  • field: logo
  • Entity reference to User [one to many]
  • other fields

Event

  • Field: Date
  • Field: Description
  • Entity reference to Organization [one to many]

The event nodes need to look like this (display the following):

  • Event Title
  • Event Date
  • Event Description
  • All the organization logos (from the organizations added as a reference entity to the event)
  • All the user logos that belong to the already referenced organizations

Is there any way to do this with already existing Drupal 8 modules or do I have to write some custom code ?

1

You could render this with four different display modes:

1.) The Event view mode to start with:

  • Event Title
  • Event Date
  • Event Description
  • Reference field for Organization, configured to render the view mode logos1
  • Reference field for Organization, configured to render the view mode logos2

2.) The Organization view mode logos1 contains one field for the Organization logos:

  • Image field logos

3.) The Organization view mode logos2 contains one field for the User logos

  • Reference field for the content type User, configured to render the view mode userlogos

4.) The content type User view mode userlogos

  • Image field for user logos

To implement two instances of the reference field you need the module Display Suite. Or combine logo1 and logos2 in one view mode with two fields, but then the logos will get mixed. Or use for the second reference field a View, with the help of EVA.

  • So clear and precise answer :) – darpet May 8 '17 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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