Build and customize powerful Drupal modules to extend your website's functionalities with this comprehensive guide
Purchase of the print or Kindle book includes a free PDF eBook
Key FeaturesExplore the new features and improved capabilities of Drupal 10 coreDiscover Drupal APIs and elevate your proficiency by leveraging PHP codingImplement efficient data management and data security by creating dedicated modulesBook DescriptionEmbark 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!
What you will learnGain insight into the Drupal 10 architecture for developing advanced modulesMaster different Drupal 10 subsystems and APIsOptimize data management by modeling, storing, manipulating, and processing data efficientlyPresent data and content cleanly and securely using the theme systemUnderstand helpful functions while dealing with managed and unmanaged filesEnsure your Drupal app has business logic integrity with automated testingImplement secure coding in DrupalWho this book is forIf you are a Drupal developer looking to create custom modules for Drupal sites and cater business needs, this book is the one-stop solution for you. Drupal 10 Module Development will be helpful for Drupal site builders and PHP developers with basic object-oriented programming skills, looking to upskill themselves in Drupal module development. A basic working experience with Symfony will be helpful but not mandatory.
Table of ContentsDeveloping for DrupalCreating your First ModuleLogging and MailingThemingMenus and Menu LinksData Modeling and StorageYour Own Custom Entity and Plugin TypesThe Database APICustom FieldsAccess ControlCachingJavaScript and the Ajax APIInternationalization and LanguagesBatches, Queues, and CronViewsWorking with Files and ImagesAutomated TestingDrupal 10 security
First of all, a disclaimer: I have been working with Drupal since Drupal 6 and also one of the regular contributors to Drupal 8 and later. I am writing this review based on my reading of a reader copy provided by the publisher. This review is my own opinion.
I think this book is a great fit for someone who has moderate programming experience and a basic awareness of Drupal. This might be a little overwhelming if you have no experience with Drupal at all or at least with Symfony style of designing applications. This is because Drupal follows patterns typical to Symfony applications and uses several of the Symfony components. If this is not you, the first chapter does a decent job of explaining Drupal for developers but in my opinion, the latter part of the book can still be quite overwhelming. The book does explain some of the basic design patterns and concepts used in Drupal but does not wait long before jumping into example code that contains all the concepts that were just mentioned.
This is not a significant problem as I know a typical Drupal developer’s journey is likely to begin with a lot of site building and community support. Most Drupal developers have entered the community in this fashion. By the time you need this book, you would have already worked enough with Drupal to build a moderately complex site by assembling various contributed modules and even writing a simple custom module or two. That is when you will begin to realize the lack of structured documentation in the official sources (the Drupal community is doing significant work to fix this) and you will go looking for a book such as this.
The book is meant to be read in any order you wish. If you haven’t worked with Drupal before, you would probably read the first two chapters and then jump to the chapter you want. There are 18 chapters in all and the order, in my opinion, is highly subjective and feels random. For example, I would prefer chapters on testing, working with files, and security near the beginning rather than at the very end. It is human nature to skip the chapters at the end of the book and we, as an industry, need to get better at security and automated testing. The order doesn’t help that at all. That is the only reason I have taken away a star from this book. The content is detailed and highly relevant to the Drupal 10 era.
For example, the chapter on caching began with the basics but the author did not lose any time in explaining the nuances of bubbling up cacheability metadata and how caching affects different scenarios such as redirects or access control. The author then soom jumps to placeholders and lazy building. All this happens in less than 20 pages, a lot of which is code listing. The author similar covers topics ranging from custom entities and custom fields to internationalization, logging, batches, JavaScript, and as I mentioned before, security and automated testing.
If you spend time regularly developing Drupal applications, then this is a very useful book to keep as reference and even read to remind yourself of what Drupal provides. It is very easy to forget the powerful features in the Drupal framework and this book fixes that problem.