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.A PDF version of this book is available at drupal10plustheming.com. Book drupal10plustheming.com
What you will learn Learn how to set up a Drupal local development environment using DDEVUnderstand the essentials of Drupal theming, including the structure of themes, theme components, and the role of Twig templatesLearn 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 sectionLearn how to incorporate HTML template CSS, JavaScript and other asset files into a Drupal themeBecome proficient at theming site Headers / Footers, Hero banners, Navigation menus, Image sliders and Drupal components such as Paragraphs, Blocks, Content nodes, Views and WebformsLearn how to override Twig templates, write custom markup, write custom CSS and preprocess functionsLearn about debug techniques 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.
Table of Contents
Preface Chapter 1 - The Website We'll Be Building Chapter 2 - Setting Up a Development Environment (using DDEV) Chapter 3 - Install the Site Chapter 4 - Configuration Management Chapter 5 - Git Setup and Initial Commit Chapter 6 - Drupal 10 Theming Overview Chapter 7 - Arsha Theme Prep Chapter 8 - Design Mockup Review Chapter 9 - Building Out the Theme Files Chapter 10 - Theming the Header and Navbar Chapter 11 - Building Out the Page Structure Chapter 12 - Front Page Theming (Part 1) Chapter 13 - Front Page Theming (Part 2) Chapter 14 - Front Page Theming (Part 3) Chapter 15 - Project Page and Portfolio Section Theming Chapter 16 - Front Page Theming (Part 4) Appendix A - Drupal Component Configuration Appendix B - Project GitHub Repo Appendix C - Contrib Modules Appendix D - Resources
This is a great book for learning about Drupal theming and many of the contribited modules. I recommend it if you are learning Drupal or as a good reference for Drupal developers.