Guide

Develop Drupal Sites for Drupal 8, 9, and 10

What will you learn

  • Alter and extend Drupal through plugins, hooks, and events
  • Create or alter forms and their workflows
  • Work with useful objects called services
  • Present content for display using the Render API
  • Utilize Drupal's menu and navigation system
  • Write secure code
  • Essential background information for module development in Drupal
  • Drupal coding standards

Overview

Developers, also known as engineers or programmers, use their knowledge of PHP, MySQL, HTML, JavaScript, and CSS to extend, alter, and enhance Drupal by creating modules. One of the more common tasks that developers do is to create “glue-code”: modules that make minor alterations to the way an existing module works that are application-specific, or modules that tie existing modules together in a unique way, without modifying the original code.

When creating solutions to meet their specific use case, developers do so with an eye towards creating reusable tools when possible, and/or collaborating with other developers to enhance existing tools that are close to, but not quite, the solution needed.

Developers are generally expected to be proficient with Drupal site building, and to know how to leverage the ecosystem of existing contributed modules and Drupal core APIs in order to prevent duplication.

PHP is the programming language in which Drupal software is written, so you should be comfortable with it before diving in. Drupal is largely written using object-oriented programming (OOP). As you learn to develop modules for Drupal, you’ll use a combination of PHP fundamentals combined with Drupal-specific functions and APIs.

Part of your journey as a developer may include developing management and leadership skills, which is why we've included our course, Introduction to Project Management, in this guide.

Drupal developer learning resources

Prerequisites

PHP

These resources in our PHP topic introduce newcomers to the coding language, PHP, which is used in Drupal coding and development.

PHP

Topic
Drupal 7, 8, 9, and 10
More information

PHP: Hypertext Preprocessor (PHP) is a popular interpreted programming language that is especially suited for web development. Drupal core and all contributed modules are written in PHP.

Object-oriented PHP concepts

Modern Drupal uses object-oriented PHP concepts, which are essential for Drupal developers to understand.

Categories
Drupal 8, 9, and 10
More information

PHP namespaces provide a way in which to group related classes, interfaces, functions and constants. Drupal uses PSR-4 namespaces to autoload the correct PHP class from a file, accommodating variations in site structures.

Drupal 8, 9, 10, and 11
More information

Object-oriented PHP utilizes classes and objects to organize code into reusable chunks. This approach helps us organize complex applications, such as Drupal, into modular code called classes that can be reused across the entire system.

Introduction to module development

The Drupal Module Developer Guide is the best way to get started with the concepts and APIs involved in writing custom code for Drupal. It's a hands-on guide that extends the Anytown Farmers Market site we built in the Drupal User Guide.

Categories
Module Development
Drupal 8, 9, and 10

Essential concepts for developers

General module development

This course contains tutorials that apply broadly to Drupal module development.

Coding standards

Tools and setup

Install Drupal and keep it up-to-date

Categories
Site Building, Backend and Infrastructure, Site Administration
Drupal 8, 9, and 10

Command line tools for Drupal

Learn more about essential command line tools for Drupal development including Composer and Drush.

Categories
Site Building, Theming, Module Development, Backend and Infrastructure, Site Administration
Drupal 8, 9, and 10

Explore module development in Drupal

Learn how to use Drupal's APIs and systems with custom code to alter, extend, and enhance your Drupal site with modules.

Essential APIs in Drupal

Hooks, plugins, events, services and dependency injection are all used by developers to extend, alter, or enhance Drupal's functionality.

Developers will need to know how to create new Drupal modules--bundles of PHP code that extend, alter, or otherwise enhance Drupal’s functionality. This requires knowledge of Drupal’s system to allow your custom code to interact with existing functionality. You'll also need to get familiar with the suite of APIs that make up the Drupal framework, many of which exist to ensure you don’t have to rewrite the same code over and over.

Categories
Module Development
Drupal 8, 9, and 10

Routing, controllers, and menus

Learn to use Drupal's routing system, PHP controllers, and how the request-response cycle works in a Drupal site to create custom pages. You'll also learn Drupal's menu system to create different types of menu links for your custom pages.

Categories
Module Development
Drupal 8, 9, and 10

Forms

In this guide, you'll learn how to use Drupal's Form API to create or alter forms in Drupal.

Categories
Theming, Module Development
Drupal 8, 9, and 10

Output themeable content

Learn how to output content using the Render API, templates, and other themable methods to ensure consistency, flexibility, and maintainability in the presentation layer, allowing designers and theme developers to customize and style the output without altering the underlying logic.

Categories
Theming, Module Development
Drupal 8, 9, and 10

Work with data

Content and configuration data are structured into entities. Content entities can have fields attached to them. Learn how to do CRUD (Create Read Update Delete) operations on different types of data in Drupal. Explore the Entity, Field, and Configuration APIs, and learn how to work with these different types of data in your custom module.

Categories
Module Development
Drupal 8, 9, and 10

Views is often the solution to the question, how do I list content and format it? Learn to use Views UI and its API to integrated your data into the Views module.

Categories
Site Building, Module Development
Drupal 8, 9, and 10

Automated testing

Learn all about automated testing, how to run tests in a Drupal environment, and explore the process of writing tests for your custom code.

Categories
Module Development
Drupal 8, 9, and 10

Upgrade from Drupal 7 or migrate a site to Drupal

Learn how to perform a Drupal-to-Drupal migration (Drupal 7 upgrade) or migrate any site or dataset to Drupal.

Categories
Module Development, Backend and Infrastructure
Drupal 8, 9, and 10

Learning tips

Learning to be a master of Drupal development can be a daunting task, especially when you’re just getting started. There’s a lot to learn, and a lot of the best information is spread out across Drupal.org and various other websites, books, and podcasts. We've created a guide that walks you through all of Drupal's essential APIs which you should start with if you are a developer who is new to modern Drupal development.

Categories
Module Development
Drupal 8, 9, and 10

As you’re climbing the ladder and becoming more proficient with Drupal, here are some things to keep in mind:

  • Drupal is open source software, and as such, the code is freely available to read. Looking at how Drupal core or other contributed modules have solved problems similar to yours is a great way to get started.
  • The Drupal API is quite extensive; focus on mastering high-level concepts and terminology first. Don’t try and memorize all the details—instead, use the tools available to look up the documentation and examples for implementation-specific details.
  • Knowing when to write custom code vs. using an existing solution is an important skill.

If you are interested in taking the Acquia Certified Developer Exam, you will also definitely want to work your way through our exam guide.

Broaden your skills

There are many ways to grow your skills and knowledge outside of tutorials. Here are some of our favorite resources for exploring Drupal development.

Contribute to the Drupal project

Although not a requirement, many Drupal developers also enjoy being active members of the Drupal community and contributing their solutions back to Drupal.org in the form of a contributed module, or by helping to resolve bugs in the modules they use, or even in Drupal core itself. Nothing will improve your understanding of Drupal like explaining it to someone else—or taking pieces of it apart and fixing them.

More information

As an open source project, Drupal depends on community contributions in many forms including documentation, code, translation, speaking, organizing events, mentoring others, and even donating money.

Categories
Drupal 7, 8, 9, and 10
More information

Drupal has an amazing community of people who create the software and help each other make the best use of it. This is one of the main benefits of using Drupal — and everyone should take advantage of that.

Community Events

DrupalCon sessions and other local/regional events are a great way to get up to speed on the latest in Drupal development. All DrupalCon sessions are recorded and are available for free on the Drupal Association’s YouTube channel. Many Drupal "Camps" (local or regional Drupal community events) also record sessions. For DrupalCon and many other Drupal events, the recorded sessions are embedded on the session description pages on the event's website.

“Drupalize.Me has trained thousands of Drupalistas. Their video lessons help to address our constant need for more Drupal talent. Drupal needs training like this to support its growth.”
Dries Buytaert
Drupal Founder and Project Lead
Photo of Dries Buytaert
“They’re easy to understand. They’re thorough. They’re funny. They’re always entertaining, and it makes it easy to learn parts of Drupal and how you can integrate it into your workflow and learn more and have a good time doing it.”
Roger Carr
Drupalize.Me Member
Photo of Roger Carr
“The mission of the Drupal Association is to foster and support the Drupal software project, the community, and its growth. Drupal education, like that provided by Drupalize.Me, is important to this mission.”
Megan Sanicki
Former Exec. Director, Drupal Assoc.
Photo of Megan Sanicki

FAQs

Am I required to sign a contract?
No. You can purchase a membership and/or cancel any time. Drupalize.Me is a pay-as-you-go service.

Can I preview tutorials before joining?
Yes! Just navigate to our tutorial library. Our free tutorials are labeled with a green "FREE" tag.

Can I watch videos on my mobile device?
Yes! Drupalize.Me is a responsive site and can be accessed in the browser on any mobile device. More FAQs