Danny Englander: Drupal 8 & 9 Tutorial: a Method to Group Fields in Layout Builder Using Ctools Entity View

I’ve been building Drupal 8 sites with Layout Builder over the past year. One feature that I think is missing is the ability to group specific fields inside a wrapper for enhanced theming; a layout within a layout if you will.

There are a few issues open in core for this feature but these seem to be just in the planning stage right now. There are some workarounds to achieve this feature.

  • Create a view with an argument that just renders the fields in context to the entity item they are a part of.
  • Use an entity view via the contrib. module, Chaos Tool Suite, AKA Ctools.

It is the second solution above that I will write about here as it is my favorite one and one which a developer friend of mine told me about. The idea behind Entity View is that you add some fields …