Book Image

Drupal 10 Module Development - Fourth Edition

By : Daniel Sipos
Book Image

Drupal 10 Module Development - Fourth Edition

By: Daniel Sipos

Overview of this book

Embark on a journey of Drupal module development with the latest edition of this must-have guide written by Daniel Sipos – a Drupal community member! This fourth edition is meticulously revised to cover the latest Drupal 10 enhancements that will help you build custom Drupal modules with an understanding of code deprecations, changing architecture, data modeling, multilingual ecosystem, and so on. You’ll begin with understanding the core components of Drupal 10 architecture, discovering its subsystems and unlocking the secrets of creating your first Drupal module. Further, you'll delve into Drupal logging and mailing systems, creating theme hooks, and rendering a layout. As you progress, you'll work with different types of data storage, custom entities, field types, and work with Database APIs for lower-level database queries. You'll learn to reap the power of JavaScript and ensure that your code works seamlessly on multilingual sites. You'll also learn to create custom views, automate tests for your functionalities, and write secure code for your Drupal apps. By the end of this book, you'll have gained confidence in developing complex modules that can solve even the most complex business problems and might even become a valuable contributor to the Drupal community!
Table of Contents (21 chapters)
3
Chapter 3: Logging and Mailing

What this book covers

Chapter 1, Developing for Drupal 10, provides an introduction to module development in Drupal. In doing so, it introduces you to the various subsystems and outlines the requirements for running a Drupal 10 application.

Chapter 2, Creating Your First Module, gets the ball rolling with the creation of the first Drupal module of the book. Its primary focus is to explore the most common things module developers need to know from the get-go.

Chapter 3, Logging and Mailing, is about the tools available for doing something every web-based application does and/or should be doing, that is, sending emails and logging events.

Chapter 4, Theming, presents the theme system from a module developer’s perspective in Drupal 10.

Chapter 5, Menus and Menu Links, explores the world of menus in Drupal and shows how to programmatically create and work with menu links.

Chapter 6, Data Modeling and Storage, looks at the various types of storage available in Drupal, from the state system to configuration and entities.

Chapter 7, Your Own Custom Entity and Plugin Types, takes a hands-on approach in terms of creating a custom configuration and content entity type, as well as a custom plugin type for wiring up a practical functional example.

Chapter 8, The Database API, presents the database abstraction layer and discusses how we can work directly with data stored in custom tables.

Chapter 9, Custom Fields, walks through the creation of the three plugins necessary for creating a custom field that can be used on a Drupal content entity type.

Chapter 10, Access Control, explores the world of access restrictions in Drupal, from roles and permissions to route and entity access checks.

Chapter 11, Caching, looks at the various cache mechanisms available for module developers to improve the performance of their functionality.

Chapter 12, JavaScript and the Ajax API, introduces module developers to the specificities of writing JavaScript in Drupal, as well as the powerful Ajax system, which can be used to build advanced interactions.

Chapter 13, Internationalization and Languages, covers the practices that Drupal module developers need to observe in order to ensure that the application can be properly translated.

Chapter 14, Batches, Queues, and Cron, explores the various ways module developers can structure their data-processing tasks in a reliable way.

Chapter 15, Views, looks at the various ways module developers can programmatically interact with views and even expose their own data to them.

Chapter 16, Working with Files and Images, explores the various file and image APIs that allow module developers to store, track, and manage files in Drupal.

Chapter 17, Automated Testing, explores the various types of automated tests that developers can write for their Drupal applications so as to ensure stable and resilient code.

Chapter 18, Drupal 10 Security, explores the most common security principles that need to be observed when developing Drupal 10 modules.