Practical Drupal Theming
This course will walk you through building your first Drupal theme. You'll learn to use and override templates, add your own CSS and JavaScript, use various features of Twig, and debug problems along the way.
When you have completed this course, you will be ready to tackle any concept in Drupal theming, having attained a good foundation to build your knowledge. You'll also have a sandbox Drupal site to use to continue your theming journey.
How the Drupal theme layer relates to the rest of the system
How to override any of Drupal's HTML output
How to add both custom and third-party CSS and JavaScript libraries
How to discover which templates are being used on a page
Everything you need to know about Twig when working with Drupal templates
Tools for introspecting and debugging a theme
To access free previews sign up for a free account
Overview
Exercise: Set Up Demo Site for Theming Practice
Overview
Structure of a Theme
An Introduction to YAML
Describe Your Theme with an Info File
Regions
Add Regions to a Theme
FREE PREVIEWTheme Inheritance with Base Themes
Use a Base Theme
Drupal Base Themes: Classy and Stable
Download, Install, and Uninstall Themes
Exercise: Create a New Theme
Overview
What Are Asset Libraries?
Define an Asset Library
Attach an Asset Library
Exercise: Add an Asset Library
Overview
Configure Your Environment for Theme Development
Exercise: Configure Your Environment for Theme Development
Overview
What Are Template Files?
Override a Template File
Determine the Base Name of a Template
Discover Existing Theme Hook Suggestions
Exercise: Override the Main Page Template
Overview
Twig in Drupal
Twig Syntax Delimiters
Arrays and Objects in Twig
Loops and Iterators in Twig
Print Values from a Field with a For Loop
Twig Filters and Functions
Make Your Theme Translatable
Classes and Attributes in Twig Templates
Routes, URLs, and Links in Twig Templates
Twig Template Inheritance
Exercise: Override the Node Template
Exercise: Override the Main Menu Template
Exercise: Override the Image Field Template
Exercise: Use the t Filter in a Template
Overview
Add Logic with THEMENAME.theme
What Are Preprocess Functions?
Change Variables with Preprocess Functions
Add Variables to a Template File
Add New Theme Hook Suggestions
Exercise: Preprocess Functions
This course covers both Drupal 9 and 8.
The course material is designed to be completed with approximately 8 hours of work for reading and watching the materials and then completing the hands-on exercises. The time it takes each person will vary based on previous experience and how much work you put into your demo site.
In order to dive into theming, you should already be familiar with setting up a basic Drupal site, including general configuration, and managing content types and users. You should also understand the fundamentals of HTML and CSS, and how a basic web page is put together. This course will be relevant for people who are new to Drupal theming as well as those looking to move from Drupal 7 to Drupal 8 or Drupal 9.
If you have trouble with the course material, you can always contact us at [email protected] and one of our trainers will help get you unstuck.
We currently only have this theming course for sale as an individual course. We have a full library of all Drupal topics available on our membership site, Drupalize.Me (https://drupalize.me/).
No. This is totally separate from Drupalize.Me memberships. This is a one-time purchase where you have access to this individual course's materials and updates for as long as you like, with no need to renew a membership.
Drupalize.Me is the top online Drupal training resource from Osio Labs - Open Source Inside and Out. We've been teaching Drupal for over 10 years through our membership site and are now making our popular online courses available for a one-time purchase instead of requiring a recurring subscription.
Osio Labs is on a mission to empower anyone to build websites using open source tools. We teach the technology and support the open source projects and communities that make it all possible.