Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Modernizing Drupal 10 Theme Development

You're reading from   Modernizing Drupal 10 Theme Development Build fast, responsive Drupal websites with custom theme design to deliver a rich user experience

Arrow left icon
Product type Paperback
Published in Aug 2023
Publisher Packt
ISBN-13 9781803238098
Length 360 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Luca Lusso Luca Lusso
Author Profile Icon Luca Lusso
Luca Lusso
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1 – Styling Drupal
2. Chapter 1: Setting up a Local Environment FREE CHAPTER 3. Chapter 2: Setting a New Theme and Build Process 4. Chapter 3: How Drupal Renders an HTML Page 5. Chapter 4: Mapping the Design to Drupal Components 6. Chapter 5: Styling the Header and the Footer 7. Chapter 6: Styling the Content 8. Chapter 7: Styling Forms 9. Chapter 8: Styling Views 10. Chapter 9: Styling Blocks 11. Chapter 10: Styling the Maintenance, Taxonomy, Search Results, and 403/404 Pages 12. Part 2 – Advanced Topics
13. Chapter 11: Single Directory Components 14. Chapter 12: Creating Custom Twig Functions and Filters 15. Chapter 13: Making a Theme Configurable 16. Chapter 14: Improving Performance and Accessibility 17. Part 3 – Decoupled Architectures
18. Chapter 15: Building a Decoupled Frontend 19. Index 20. Other Books You May Enjoy

What this book covers

Chapter 1, Setting Up a Local Environment, guides you to set up an opinionated local environment to work with Drupal. You’ll learn how to install and configure some tools such as Docker, DDEV, and Visual Studio Code. We’ll then clone a Git repository, install Drupal, and set up the system to start working on the frontend.

Chapter 2, Creating a New Theme and Setting Up a Build Process, starts by discussing building a new theme instead of using a ready-to-use one. You’ll learn what a starter kit is and how to use it to generate a new theme. Finally, we set up some processes to enforce coding standards, both locally and in a continuous integration pipeline.

Chapter 3, How Drupal Renders an HTML Page, talks about the rendering pipeline of Drupal. You’ll learn everything you need to know about how Drupal turns its internal data structures into HTML pages, with CSS and JavaScript attached.

Chapter 4, Mapping the Design to Drupal Components, explains how to develop the design system. We’ll step away from Drupal briefly to talk about how to split pages into components and how to use tools such as Storybook to work on templates, before setting up a Drupal instance. Subsequently, we will map each component to a data structure in Drupal.

Chapter 5, Styling the Header and Footer, examines the layout that stays the same on every page. In this chapter, you’ll learn about regions and blocks, how to override a core template to provide your own, and how to style a Drupal menu.

Chapter 6, Styling the Content, digs into the main part of a Drupal page, the content. We’ll talk about entities and fields, media, and taxonomies. You’ll learn some different ways to structure content in Drupal and how to customize the WYSIWYG editor.

Chapter 7, Styling Forms, explores how forms work on a Drupal site. You’ll learn how a form is structured, which templates it uses, and how to override and style them. We’ll then use the acquired knowledge to style the user login form.

Chapter 8, Styling Views, discusses one of the most complex topics in Drupal core. The Views module is as powerful as it is difficult to understand and style. We’ll talk about Views templates, exposed filters, and pagers.

Chapter 9, Styling Blocks, details how to style the parts of a page that aren’t the main content. You’ll learn the differences between editorial and programmatic blocks and how to style titles and breadcrumbs.

Chapter 10, Styling Maintenance, Taxonomy, Search Results, and 403/404 Pages, discusses a set of pages that sometimes are overlooked but that provide a great level of professionalism if styled correctly.

Chapter 11, Single Directory Components, digs into one of the new features of Drupal. We’ll discuss how Drupal core implements the concept of components and how to leverage it to rebuild some of our templates using the new approach. You’ll learn how to use and override components and expose them to Storybook.

Chapter 12, Creating Custom Twig Functions and Filters, explains how to extend Twig. You’ll learn how to define a new function and a new filter for Twig and why this is the best way to move the business logic away from the theme layer.

Chapter 13, Making a Theme Configurable, explores how Drupal allows you to reuse the same theme on different websites by making it configurable. We’ll also talk about sub-theming and how and when it’s helpful to define a sub-theme.

Chapter 14, Improving Performance and Accessibility, discusses optimizations. You’ll learn how to improve the performance of your website and how to make it as accessible as possible, as your users deserve.

Chapter 15, Building a Decoupled Frontend, scratches the surface of one of the most hyped topics in recent years. We’ll talk about how to leverage Drupal APIs to expose content and configuration to third-party systems and how to write some simple JavaScript clients to consume that data. You’ll learn how to install and configure a Next.js instance to build a fully decoupled site.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime