
Drupal 10 Development Cookbook
By :

Drupal provides display view modes that allow you to customize the fields and other properties attached to an entity. In this recipe, we will adjust the teaser display mode of an Article
content type. Each field or property has controls for displaying the label, the format to display the information in, and additional settings for the format.
Harnessing view displays allows you to have full control over how content is viewed on your Drupal site.
Article
content type’s display. Click on the drop button arrow and select Manage display.600
to 300
.The default rendering system for an entity uses view displays. View display modes are configuration entities. Since view display modes are configuration entities, they can be exported using configuration management.
When a content entity is rendered, the view display goes through each field formatter configured in the display. The field formatter is the option chosen from the Format property of the Manage Display form and identifies what code should be used to render the field value. The field value is retrieved from the entity and passed to the field formatter plugin that has been instantiated with the configuration provided to the view display. This collection of render data is then passed through the rest of Drupal’s render pipeline.
We will discuss more items for managing the form of a content entity in the following section.
Additional form display modes can be added by visiting Structure and then Display Modes under View Modes. Each content entity type has a hidden default view mode that always exists. Additional view display modes can be added and configured using the display management form.
These view modes can then be leveraged when displaying content with views, the Rendered entity field formatter for entity references, or when rendering entities with custom code.