Master the art of Drupal theming
In this book, you’ll be guided through the detailed and practical steps needed to transform an HTML template into a fully functional Drupal theme. From setting up a development environment to building a complete and themed Drupal site, all aspects of the theming process are covered.
Starting with an HTML template and a vanilla Drupal 10 site, we go step-by-step through the process of creating a Drupal theme from scratch. Most theming courses and tutorials theme a basic site, in this book we’ll be theming a fairly complex business site. The site is based on Drupal 10.1 but the material and information contained within is applicable to any Drupal 10.x or Drupal 11 site.
A GitHub repo accompanies this book and provides a chapter-by-chapter file set, database "snapshot" and screenshots.
What you will learn
Learn how to set up a Drupal local development environment using DDEV
Understand the essentials of Drupal theming, including the structure of themes, theme components, and the role of Twig templates
Learn how to dissect and analyze an HTML template and identify the Drupal components (Content types, Blocks, Views, Image styles etc.) needed to build and theme each section
Learn how to incorporate HTML template CSS, JavaScript and other asset files into a Drupal theme
Become proficient at theming site Headers / Footers, Hero banners, Navigation menus, Image sliders and Drupal components such as Paragraphs, Blocks, Content nodes, Views and Webforms
Learn how to override Twig templates, write custom markup, write custom CSS and preprocess functions
Learn about debug commands and how to use them during theme development
Who this book is for
This book is mostly intended for website developers involved with Drupal but also for anyone interested in Drupal theming. It assumes knowledge of HTML, CSS and basic familiarity with the Twig templating language. To get the most out of this book, prior experience with Drupal and basic Drupal site building is helpful. To aid the site building aspects, a comprehensive set of screenshots and summaries are provided for all Drupal component creation and configuration.