Views style plugins

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/style/StylePluginBase.php \Drupal\views\Plugin\views\style\views_style_plugins
  2. 10 core/modules/views/src/Plugin/views/style/StylePluginBase.php \Drupal\views\Plugin\views\style\views_style_plugins
  3. 11.x core/modules/views/src/Plugin/views/style/StylePluginBase.php \Drupal\views\Plugin\views\style\views_style_plugins

Plugins that control how the collection of results is rendered in a view.

Style plugins control how a view is displayed. For the most part, they are object wrappers around theme templates. Examples of styles include HTML lists, tables, full or teaser content views, etc.

Many (but not all) style plugins have an optional row plugin, which displays a single record. Not all style plugins use row plugins, so it is up to the style plugin to set this up and call the row plugin. See the Views row plugins topic for more information.

Style plugins extend \Drupal\views\Plugin\views\style\StylePluginBase. They must be annotated with \Drupal\views\Annotation\ViewsStyle annotation, and they must be in namespace directory Plugin\views\style.

See also

Plugin API

Parent topics

File

core/modules/views/src/Plugin/views/style/StylePluginBase.php, line 14

Classes

Title Sort descending File name Summary
DefaultStyle core/modules/views/src/Plugin/views/style/DefaultStyle.php Unformatted style plugin to render rows.
DefaultSummary core/modules/views/src/Plugin/views/style/DefaultSummary.php The default style plugin for summaries.
EntityReference core/modules/views/src/Plugin/views/style/EntityReference.php EntityReference style plugin.
Grid core/modules/views/src/Plugin/views/style/Grid.php Style plugin to render each item in a grid cell.
HtmlList core/modules/views/src/Plugin/views/style/HtmlList.php Style plugin to render each item in an ordered or unordered list.
Mapping core/modules/views/src/Plugin/views/style/Mapping.php Allows fields to be mapped to specific use cases.
MappingTest core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/MappingTest.php Provides a test plugin for the mapping style.
Opml core/modules/views/src/Plugin/views/style/Opml.php Default style plugin to render an OPML feed.
Rss core/modules/views/src/Plugin/views/style/Rss.php Default style plugin to render an RSS feed.
Serializer core/modules/rest/src/Plugin/views/style/Serializer.php The style plugin for serialized output formats.
StylePluginBase core/modules/views/src/Plugin/views/style/StylePluginBase.php Base class for views style plugins.
StyleTemplateTest core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTemplateTest.php Provides a general test style template plugin.
StyleTest core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php Provides a general test style plugin.
Table core/modules/views/src/Plugin/views/style/Table.php Style plugin to render each item as a row in a table.
UnformattedSummary core/modules/views/src/Plugin/views/style/UnformattedSummary.php The default style plugin for summaries.
ViewsStyle core/modules/views/src/Annotation/ViewsStyle.php Defines a Plugin annotation object for views style plugins.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.