Module Development

Use Config Actions in a Recipe for Drupal 10, 11

The Configuration Actions API lets recipes modify existing configuration rather than just adding new configuration. By extending the SEO Article recipe created in a previous tutorial with config actions, you'll learn how to manipulate existing configuration objects in order to do things like grant permissions and modify entity display modes. This is necessary because sometimes a recipe needs to modify configuration that already exists on the site, not just add new configuration.

In this tutorial, we will:

  • Add config actions to grant permissions to existing roles
  • Modify entity displays using config actions
  • Reapply recipes and observe idempotent behavior
  • Experiment with new content types to understand recipe limitations

By the end of this tutorial, you'll be able to use common config actions in your recipes and understand how recipes behave when reapplied.