Site Building

Tips for Theming with Layout Builder for Drupal 8, 9, and 10

One of the challenges that comes with Layout Builder is increased complexity of front-end development. Layout Builder offers site administrators increased flexibility regarding the placement and use of fields and blocks; a theme developer needs to account for this. Depending on how Layout Builder is used, this could mean a small number of new combinations, or virtually infinite combinations. Therefore, predicting and theming all of these combinations becomes a difficult but necessary task in order to ensure maintainability and overall design consistency.

In this tutorial we'll look at some things we've found helpful to consider when theming Layout Builder including:

  • Design, and theme, atomic components
  • Limit the number of possible combinations of fields by using entity view modes
  • Handle edge cases

By the end of this tutorial you should have a better understanding of how using Layout Builder can impact theme development, and how to account for it.