Devel is a popular developer module containing a variety of developer and debugging utilities that make it more efficient to perform common development tasks. The Devel module includes Devel Generate, a module for generating example content. Devel also features Drush integration and provides several custom Drush commands. Other modules such as Webprofiler and vardump-enhancement libraries such as Kint can be configured via Devel.
Example tasks
- Quickly generate dummy content (menu items, terms, and nodes) for a development site
- Get insight into variables under the hood
Confidence
Devel has been a popular developer module and suite of tools since Drupal 6. As such, learning materials exist for Devel that can be quite dated. For current features and compatibility see the Drush project page on drupal.org.
Drupalize.Me resources
More information
Knowing how to inspect the variables available within a template file enables you to discover all of the dynamic content in a Twig file, not just that which is already being used.
In this tutorial, we'll learn how to use {{ dump() }}
, kint()
, vardumper()
, and XDebug to inspect variables in a template file.
More information
Set up a local development environment to practice Drupal theme development exercises in our course, Hands-On Theming Exercises for Drupal.
By the end of this tutorial, you should be able to:
- Install Drupal on your computer, so you can edit files in your theme.
- Generate dummy content, so that you have different kinds of pages to theme.
More information
Since we haven’t been creating much content on our site, the My Workbench page is rather empty. This can make it hard to understand what’s going on and to grasp the module’s possibilities. This is a situation that you’ll encounter often when developing a site: at a certain point, you need content to test a certain feature, or to verify what a certain section on your site will look like. The Devel Generate module, which comes with the Devel module allows us to quickly generate sample content, users, taxonomy, and menu items, so testing functionality on our new site becomes a lot easier, since it will more closely resemble an actual site. In this lesson we'll enable and configure Devel Generate, and then run it to get a bunch of filler content set up on our site.
Additional resources
Using Drupal, 2nd edition
Using Drupal source code
Drupalize.Me Guide: Using Drupal Book by O'Reilly Media
External resources
-
Devel (drupal.org)
- The project page for Devel, which describes the submodules and utilities contained within the project.
-
Drupal 8 Module of the Week: Devel (dev.acquia.com)
- In this interview, project maintainer Moshe Weitzman describes the main modules inside Devel and how they can be used.