Module Development

Create a Configuration Entity Type for Drupal 8, 9, 10, and 11

In this tutorial, we’re going to walk through the process of creating a custom configuration entity type in Drupal in a custom module. We'll be using Drush's generate entity:configuration command to create and update the files in our example module. After Drush has generated and updated the files for our configuration entity, we'll walk through each file and see how they define data structure, metadata, an administrative interface, and menu links for a configuration entity in Drupal.

By the end of this tutorial, you should be able to:

  • Use Drush to generate a configuration entity type
  • Identify files associated with a configuration entity and summarize the purpose and function of the code inside each file