Book Image

Drupal 10 Development Cookbook - Third Edition

By : Matt Glaman, Kevin Quillen
Book Image

Drupal 10 Development Cookbook - Third Edition

By: Matt Glaman, Kevin Quillen

Overview of this book

This new and improved third edition cookbook is packed with the latest Drupal 10 features such as a new, flexible default frontend theme - Olivero, and improved administrative experience with a new theme - Claro. This comprehensive recipe book provides updated content on the WYSIWYG (What You See Is What You Get) editing experience, improved core code performance, and code cleanup. Drupal 10 Development Cookbook begins by helping you create and manage a Drupal site. Next, you’ll get acquainted with configuring the content structure and editing content. You’ll also get to grips with all new updates of this edition, such as creating custom pages, accessing and working with entities, running and writing tests with Drupal, migrating external data into Drupal, and turning Drupal into an API platform. As you advance, you’ll learn how to customize Drupal’s features with out-of-the-box modules, contribute extensions, and write custom code to extend Drupal. By the end of this book, you’ll be able to create and manage Drupal sites, customize them to your requirements, and build custom code to deliver your projects.
Table of Contents (17 chapters)

What this book covers

Chapter 1, Up and Running with Drupal, walks through how to create a new Drupal site and the system requirements for running Drupal, and then run the Drupal site locally using modern local development tools based around Docker.

Chapter 2, Content Building Experience, dives into how to set up your content editing experience and add an editorial review workflow.

Chapter 3, Displaying Content through Views, walks through creating a page to list blogs and a companion block to display five of the most recent blogs using the views module, a visual query builder.

Chapter 4, Extending Drupal with Custom Code, explores how to create a custom module that can be installed onto your Drupal site.

Chapter 5, Creating Custom Pages, demonstrates how to create custom pages with controllers and routes. Creating custom pages allows you to extend Drupal beyond just content pages.

Chapter 6, Accessing and Working with Entities, covers create, read, update, and delete (CRUD) operations when working with entities in Drupal. We will create a series of routes to create, read, update, and delete nodes that are articles.

Chapter 7, Creating Forms with the Form API, covers the usage of the Form API, which is used to create forms in Drupal without writing any HTML.

Chapter 8, Plug and Play with Plugins, covers implementing a block plugin. We will use the Plugin API to provide a custom field type along with a widget and a formatter for the field. The last recipe will show you how to create and use a custom plugin type.

Chapter 9, Creating Custom Entity Types, explains how to create custom entity types for custom data models.

Chapter 10, Theming and Frontend Development, covers how to create a theme, work with the Twig templating system, and harness Drupal’s responsive design features.

Chapter 11, Multilingual and Internationalization, demonstrates the multilingual and internationalization features of Drupal 10,

Chapter 12, Building APIs with Drupal, walks through how to create RESTful APIs in Drupal with JSON:API, showing you how to read and manipulate data through HTTP requests.

Chapter 13, Running and Writing Tests with Drupal, dives into running and writing automated tests with PHPUnit for your custom module code.

Chapter 14, Migrating External Data into Drupal, explains how to migrate from an older version of Drupal to Drupal 10, and walks through using the Migration module to migrate content and data from CSV files and HTTP APIs.