
Upgrade to Drupal 11
FreeThere’s no one-size-fits-all path to upgrade from Drupal 10 to Drupal 11, but there is a set of common tasks that everyone will need to complete.
In this tutorial we’ll:
- Explain the differences between Drupal 10 and Drupal 11 that affect the upgrade path.
- Walk through the high-level steps required to upgrade from Drupal 10 to Drupal 11.
- Provide resources to help you create an upgrade checklist and start checking items off the list.
By the end of this tutorial you should be able to:
- Explain the major differences between Drupal 10 and 11.
- Audit your existing Drupal 10 projects for Drupal 11 readiness, and estimate the level of effort involved.
- Start the process of upgrading your site from Drupal 10 to Drupal 11.
We always love the opportunity to participate at in-person Drupal events, hang out with old friends, make new ones, and just in general share our enthusiasm for Drupal with others. That's why we're headed to MidCamp 2017 in Chicago March 30th - April 2nd, where we'll be offering our Drupal 8 Theming workshop, attending the camp, and participating in the sprints.
Writing a React application requires including the React JavaScript library in the page, writing some React-specific JavaScript, and then binding it to a specific DOM element on the page. You may also want to include existing packages from the npm ecosystem, and use modern JavaScript (ES6+) features, which necessitates setting up a build toolchain for your JavaScript using a tool like Webpack or Parcel.
There are a lot of different ways you could go about setting this all up. Do you add React via a theme or a module? Do you need a build tool? Should you use Webpack, or Babel, or Parcel, or something else? While we can't possibly cover all the different approaches, we can help you figure out what is required, and you can adapt our suggestions to meet your needs.
In this tutorial we'll:
- Create a new custom theme with the required build tools to develop React applications
- Add a DOM element for our React application to bind to
- Create a "Hello, World" React component to verify everything is working
By the end of this tutorial you'll know how to configure everything necessary to start writing React within a Drupal theme.
Drupal 8 Beta is So Close
Blog postRecently, the biggest piece of news in the Drupal 8 world is that we are finally down to just one beta-blocker. This is really great, but what does it mean exactly? Well, in the big picture it means that we are very close to releasing a beta version of Drupal 8 for everyone to start playing with, and this is a major step towards getting the final release out the door.
Dive in to DrupalCon
Blog postJoe's list: 2019 DrupalCon events and classes for those new to Drupal
Every theme can contain an optional THEMENAME.theme file. This file contains additional business logic written in PHP and is primarily used for manipulation of the variables available for a template file, and suggesting alternative candidate template file names. Themes can also use this file to implement some, but not all, of the hooks invoked by Drupal modules.
In this tutorial we'll learn:
- The use case for THEMENAME.theme files, and where to find them
- The different types of functions and hooks you can implement in a THEMENAME.theme file
By the end of this tutorial you should be able to know how to start adding PHP logic to your custom theme.
Concept: Render API
FreeDrupal's Render API plays a crucial role in how content is presented on a site. The Render API manages how content is rendered through render arrays and render elements.
In this tutorial, we'll:
- Define render arrays, highlighting properties and elements.
- Explain how render elements are used as shorthand for complex structures.
- Describe the primary types of data we can use in a render array.
- Touch on the role of renderers and special methods for rendering entities.
By the end of this tutorial, you'll better understand how Drupal constructs a page's output through render arrays and streamlines rendering with render elements.
Upgrade to Drupal 10
FreeThere’s no one-size-fits-all path to upgrade from Drupal 9 to Drupal 10, but there is a set of common tasks that everyone will need to complete.
In this tutorial we’ll:
- Explain the differences between Drupal 9 and Drupal 10 that affect the upgrade path.
- Walk through the high-level steps required to upgrade from Drupal 9 to Drupal 10.
- Provide resources to help you create an upgrade checklist and start checking items off the list.
By the end of this tutorial you should be able to explain the major differences between Drupal 9 and 10, audit your existing Drupal 9 projects for Drupal 10 readiness, estimate the level of effort involved, and start the process of upgrading.
Code generators are great productivity boosters that allow generating scaffolds for common development tasks in Drupal. One of the most common use cases for generators is scaffolding the code required for a custom entity type. Custom entities require many files and complicated annotations in order to function properly. There is a lot of boilerplate code that is more-or-less the same for every entity type. Creating all the files is repetitive, time-consuming, and prone to human error. Generators can help automate this task and make creating your own custom entity types quicker.
In this tutorial we'll:
- Learn how to generate the code for a custom entity with Drush
- Learn about the options that generators provide for custom entities
By the end of this tutorial you should know how to generate custom entities with Drush.
Learn Views in Drupal 8
Blog postOne of the big changes in Drupal 8 is that Views, the most popular contributed module in Drupal 7, is now included as part of core. Learning Views is a key component of learning to build Drupal sites. Aside from having this tool built in core now, the beauty of this new feature is that it is almost identical to Views in Drupal 7. You can get started site-building with Views in Drupal 8 without waiting for any fancy version-specific instructions.
Of the 3 main components of the field system -- types, widgets and formatters -- only 1 has an impact on the actual display of content for end users: field formatters. Field formatters are responsible for taking the data stored by a field and transforming it into the markup that is sent to the browser when an end user views your site.
In this tutorial we'll:
- Look at the role field formatters play in the Field API
- Identify the main components that make up a field formatter
By the end of this tutorial you should be able to define the role of a field formatter plugin.
React and Drupal can be used together in two different ways: fully decoupled, also known as headless; or progressively decoupled.
In this tutorial we'll talk about the differences between these two approaches, including:
- Defining what each method refers to
- Considerations regarding hosting, performance, and access
Then we'll link to lots of additional reading materials so you can gain a deeper understanding of the subject.
By the end of this tutorial you should be able to define what decoupled and progressively decoupled mean, and how they differ from one another.
You may have heard some news about the fact that a new theme has been added to Drupal, named Classy. But what kind of theme is it exactly? Is it a pretty new look for Drupal 8? Well, no. You will still see Bartik as the default theme on your Drupal 8 site, so why another theme? Classy is a new base theme in core, which Bartik and Seven will then use as their bases. The idea here is to provide more flexibility to themers when it comes to choosing default CSS classes.
Drupal modules need to ensure that any strings of text they add in code can be localized by Drupal's translation system. When our code creates a new <button>
element with the text "Toggle forecast" it needs to be done in a way that would allow changing that text to another string, like "Alternar pronóstico", depending on the user's preferred language.
In this tutorial, we'll:
- Define the difference between internationalization and localization and how they allow a Drupal site to be translated.
- Explore the utilities available to module developers to ensure that the user interface strings in their code are translatable.
By the end of this tutorial, you should be able to explain how and why to internationalize the code in your Drupal modules.
Before we start writing any React code, let's go over some basic concepts and terminology. Throughout this series we'll assume you're familiar with these things. They'll come up again and again as you work on projects that involve React, so it's worth taking the time to learn them.
In this tutorial we'll cover the following at a high level, and provide links to resources:
- Why choose React?
- What are React components?
- What are hooks, state, and JSX?
- The role of build tools when developing React applications
By the end of this tutorial you should have a firm grasp of the fundamental concepts and terminology necessary to start creating React applications.
The Render API consists of a standard format for describing data using structured arrays and a process for converting those arrays into the HTML a user sees when interacting with a Drupal site.
Using hook_views_post_render()
Drupal module developers can change the render array representation of a View before it gets displayed. You can use this to modify the computed HTML of a view just before it gets printed. This hook is similar to using a preprocess function for a template file, but in this case you have access to the whole render tree, not just the specific leaf covered by the template file you're preprocessing.
This hooks gets called after the Views object has been through the render process, and all the different configured displays and formatters have been applied, producing a render array representation of the results of the view. This hook receives an $output
parameter which contains the render array, and only changes made directly to the $ouput
variable will have any effect. This hook is the last chance to make changes to the render array before it is converted to markup.
You can use hook_views_post_render()
to change #cache
properties for the View, and to do things like add CSS classes to rows, and change the page title.
In this tutorial we'll:
- Learn how to alter a view's rendered output right after the Views object completes the render phase of the build cycle.
- Use
hook_views_post_render()
to change the title of the view's display
By the end of this tutorial you should know how to alter the render array generated by a View prior to it being passed to the theme layer and converted to HTML.
Hands-On Theming in Drupal
This workshop will familiarize front-end developers with Drupal's theme system through a combination of presentations, hands-on exercises, and group activities. Whether your goal is to theme your personal site, pass the Acquia front-end developer certification, or upgrade your skills for a job, our goal is to provide students with a solid foundation and enough knowledge to continue to practice and learn on their own.
You'll come away from this course knowing:
- How the Drupal theme layer relates to the rest of the system
- Common theming terminology and processes
- How to override any of Drupal's HTML output
- The relationship between base themes and sub-themes
- Everything you need to know about Twig when working with Drupal templates
- How to add both custom and third-party CSS and JavaScript libraries
- Tools for introspecting and debugging a theme
- Tips and tricks for using common front-end development tools like CSS preprocessors and task runners, in conjunction with Drupal
In addition to the real-time instructor-led workshop, attendees will also receive:
- Example code with extensive documentation suitable for use as reference material for future projects
- A PDF workbook with exercises, and solutions
- Access to pre-recorded explanations of the solutions for all exercises
- 1 month of free access to the entire Drupalize.Me tutorial catalog
Target audience:
- Individual developers who want to learn to customize existing themes, or create entirely new custom themes, for Drupal 9 and 10
- Teams of developers working together who have one or more themes that need to be upgraded for Drupal 9 and 10
- Anyone who needs a refresher on how Drupal themes work, or whose only experience so far is theming Drupal 7 sites
Assumptions:
Attendees should be familiar with HTML and CSS and understand how to administer content on a Drupal website. This workshop will be relevant for people who are new to Drupal theming as well as those looking to move from Drupal 7 to Drupal 10.
Details about what we'll cover
The workshop will be broken down into sections, and each section will consist of a combination of live presentation, hands-on exercises, and group practice activities.
Theming overview
In this section we’ll talk about the role that themes play in the creation of a Drupal site, get an overview of the types of things you can, and can not, do with a theme, go over the structure of a theme, and discuss theming specific concepts like regions, libraries, and inheritance.
Getting started with a new theme
In this section we’ll look at how Drupal uses *.info.yml files to collect metadata about available themes. Then, as an exercise we’ll create the foundation for a new custom theme, and discuss where the markup you see in a Drupal theme comes from. We’ll also walk through some things you can do when setting up your local environment in order to make theme development easier.
CSS & JavaScript libraries
There are a couple of different ways that you can add CSS and JavaScript to your theme, and we’ll walk through them while discussing the pros and cons of each. We’ll also look at how to use CSS preprocessors like Sass, and task runners like Grunt in conjunction with Drupal themes. Opening up the possibility to use a variety of existing front-end frameworks and libraries as part of your custom theme.
Overriding default markup
In this section we’ll examine Drupal’s use of Twig template files to generate HTML markup, and walk through the process of overriding that markup in our custom theme. We’ll look at how Drupal determines which template file to use, dynamic template file naming, and how to manipulate the HTML output in a template file.
Twig
Having a firm grasp of the Twig template language is essential. So we’ll spend some time going over the language’s syntax, look at how to print output, and use filters and functions to manipulate variables. Then we’ll walk through a couple of exercises that require using Twig to modify elements in our theme.
Preprocessing and more
In this section we’ll talk about using {theme-name}.theme files to add, and manipulate the variables available in a Twig template, and to conditionally add CSS and JavaScript libraries on only the pages where they are needed in order to increase page speed.
As a theme developer you can extend an existing asset library to include custom CSS and/or JavaScript from your theme. This is useful when you want to add styles or behaviors to components provided by Drupal core or another module.
Sometimes there are CSS or JavaScript asset libraries attached to the page by Drupal core, a contributed module, or another theme, that do something you don't like, and you want to change it or even exclude it all together. There are a couple of different ways that themes can override, alter, or extend, an existing asset library in order to modify the CSS and JavaScript that get attached the page by other code belonging to another theme or module.
In this tutorial we'll learn how to:
- Extend an existing asset library using
libraries-extend
, so that our custom CSS and JavaScript is included whenever that library is used. - Override an existing asset library using
libraries-override
, to alter the definition of the library, and replace or exclude individual assets (or the entire library).
By the end of this tutorial you should be able to use your custom theme to override, extend, or alter any of the asset libraries added to the page by another theme or module.
One of the primary ways that modules extend Drupal is by adding dynamic pages with content generated by application-specific logic. This tutorial looks at Drupal's process of handling a user's request and transforming it into a complete web page. We'll answer questions like:
- How does Drupal use Symfony's HttpKernel to process requests?
- How do user-configured blocks and the theme layer contribute to the page's content and appearance?
- What is the role of routes, controllers, and responses in this process?
In this tutorial, we'll:
- Follow the journey of a user request from URL to an HTML response in Drupal.
- Define the role of routes, controllers, and responses in Drupal's request handling.
- See how blocks and the theme layer contribute to the final output of a Drupal page.
By the end of this tutorial, you should be able to describe Drupal's request flow, understand the interaction of its key components in building a page, and appreciate the modular architecture that drives Drupal's flexibility.