I have a content type with a field that is an entity reference to another content type called "URLs", and the "Allowed number of values" is set to "Unlimited", meaning that one record can have multiple URLs associated to it.

When I come to the View for this node, I have added a Field for "URLs", and under "MULTIPLE FIELD SETTINGS" I have ticked "Display all values in the same row", and Display type: Unordered list.

This works well, and I get the the list of associated URLs in an unordered list, like so:

  • www.domain1.com
  • www.domain2.com
  • www.domain3.com

Where it gets complicated, my "URLs" content type has another field called "field_url_type", which is a field type "List (text)". This contains the type of URL, (eg. Production, Development, Staging, Decommissioned, etc).

In the main content type display View, I would like to display this additional field from the URL content type next to the URL values, like so:

  • www.domain1.com (Production)
  • www.domain2.com (Development)
  • www.domain3.com (Decommissioned)

I tried using the Views > Configure Field > REWRITE RESULTS panel to include the REPLACEMENT PATTERNS for both fields, like so:

{{ field_url }} ({{ field_url_type }})

... but this didn't work. I'm guessing it is more complicated than that!

Does anyone know how I can display this additional field from a content type referenced by an entity reference field in a node view?

1 Answer 1


Many solutions for this but to pick one :)

  • Download and enable Display Suite https://www.drupal.org/project/ds
  • Go to admin/structure/ds/fields and a token field (see screenshot #2 for values, adjust according to your field names)
  • Go to view mode of your Url content type and create a seperate view mode, e.g. called entity_reference_url_view or something (I just picked teaser for this example) . Make sure to select One column layout so Display suite will make your custom token field available to you (see screenshot #1)
  • add the custom token field you added earlier to the visible section
  • Now go to your other content type view at e.g. admin/structure/types/manage/your_content_type/display/full and select Rendered Entity as the format and choose your previously created view mode of the URL content type (see screenshot #3
  • Now view your content type and the entity reference fields should show up in the format you defined in your custom Display suite field

Screenshot #1 enter image description here

Screenshot #2 enter image description here

Screenshot #3 enter image description here

  • Thanks @undersound, I will give this a go and report back! Sep 19, 2019 at 11:11

Your Answer

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

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