Module Development

Display a List of Vendors for Drupal 8, 9, 10, and 11

Drupal allows site administrators to configure view modes, defining an entity's display. As module developers, we use view builders to transform an entity object into a renderable array, respecting site-specific configurations without hard-coding display details.

In this tutorial, we'll:

  • Introduce view builders and explain their significance in entity rendering.
  • Develop a route and controller for a new /attending page
  • Use an entity query to retrieve vendor nodes and render them with view builders

By the end of this tutorial, you'll know how to display entities using a site-specific teaser view mode.

Drupal Module Developer Guide