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.
Object-oriented PHP concepts
Modern Drupal uses object-oriented PHP concepts, which are essential for Drupal developers to understand.
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.
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
Command line tools for Drupal
Learn more about essential command line tools for Drupal development including Composer and Drush.
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.
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.
Forms
In this guide, you'll learn how to use Drupal's Form API to create or alter forms in Drupal.
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.
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.
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.
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.
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.
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.
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.
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.
- DrupalCon — Find links to past and future DrupalCons and session recordings.
- Drupical — Filter and find Drupal camps, sprints, user groups, and training events.
- Upcoming Drupal community events — Filter and find Drupal-related events.