Architecture Decision Records (ADRs)

← Home

In views displays use entity display modes instead of fields

Introduction

When displaying entities in views use entity display modes, not fields.

Decision

When building views, use entity display modes instead of field configuration when possible. If existing view modes don’t line up with the intended style or content availability create a new view mode to avoid affecting existing pages.

Context

View queries are faster and better optimized when the view queries the whole entity instead of adding joins to the field tables. It’s also easier to theme a display mode that can be reused across the site components outside the view's context than re-theming fields for one particular scenario. Having view mode templates keeps the theme clean and organized, and it’s easy to see which template is being used. Therefore, using display modes in views improves site performance and decreases the time required for theming.

Consequences

Exceptions

Additional Resources

None

← See more ADRs