- Drupal 8 Development Cookbook(Second Edition)
- Matt Glaman
- 163字
- 2025-04-04 18:20:51
Format style plugins - style and row
Within Views, there are two types of style plugins that represent how your data is displayed: style and row:
- The style plugin represents the overall format
- The row plugin represents each result row's format
For example, the grid style will output multiple div elements with specified classes to create a responsive grid. At the same time, the table style creates a tabular output with labels used as table headings.
Row plugins define how to render the row. The default content will render the entity as defined by its selected display mode. If you choose Fields, you can manually select which fields to include in your view.
Each format style plugin has a corresponding Twig file that the theme layer uses. Refer to the Twig templating recipe of Chapter 5, Frontend for the Win to learn more about Twig in Drupal 8.
You can define new plugins in custom modules or use contributed modules to access different options.