Skip to main content

Introducing the Display Suite Chained Fields module for Drupal 8

Need a way to mix fields from referenced entities with regular fields from managed display?

Then the Display Suite Chained Fields module might be for you.

by Lee Rowlands /

So how do you go about using the module?

Step 1: Enable a display suite layout for the view mode

To use the chained fields functionality, you must enable a display suite layout for the view mode. Select a layout other than none and hit Save.

Screenshot showing how to go about enabling a layout

Enabling a layout

Step 2: Enable the entity reference fields you wish to chain

To keep the manage display list from being cluttered, you must manually enable the entity reference fields you wish to show chained fields from. For example, to show the author's picture, you might enable the 'Authored by' entity reference field, which points to the author. After you've enabled the required fields, press Save.

Screenshot showing enabling the fields for chaining

Enabling fields for chaining

Step 3: Configure the chained fields as required

Finally, just configure the chained fields as normal.

Screenshot showing chained fields available for configuration

Configuring chained fields

That's it - let me know your thoughts in the comments or the the issue queue.

Posted by Lee Rowlands
Senior Drupal Developer

Dated

Comments

Comment by 2pha

Dated

Project page 404 ?

Comment by Lee Rowlands

Dated

Yes, but that only lets you pick a single field, this lets you pick each field on the referenced entity that allows view configuration. In the screenshot, you can see there are multiple fields from course exposed.

Comment by John

Dated

I don't use Display Suite myself, but I think this is quite a powerful feature for Site builders doing so. Nice job!

Comment by Adrian83

Dated

Excellent concept!

So, I guess the current alternative in core would be to configure a view mode on the referenced entity and display rendered entity for the reference field itself. But your module allows builders to mix and match fields from the referenced entity with fields from the referencing entity in an easy to use way.

I wonder if this concept could simplify Drupal Commerce 2.x layouts?

Comment by Lee Rowlands

Dated

It should work for any entity type

Comment by _benjy

Dated

Nice module Lee, I like it!

Comment by J-F Bohemier

Dated

Wonderful! That's a great module! 👍

Comment by Fahad

Dated

Awsome. I was looking for this functionality for quite some time. Just want to know if it is stable enough to be used in production site ??

Comment by Lee Rowlands

Dated

I will provide an update path, as I'm using it on a client site.

Comment by Hamza

Dated

That's a great module, much appreciated.

Comment by Fahad Ur Rehman

Dated

Simply a lifesaver.

Pagination

Add new comment

Restricted HTML

  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Not sure where to start? Try typing "hello" or "help" if you get stuck.