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.
The Configuration Actions API is a powerful feature of Drupal recipes that allows you to modify existing configuration without replacing it entirely. While configuration exports let you add new configuration, config actions let you update what's already there—like granting permissions to an existing role or adjusting display settings. Effectively, config actions are a way for a recipe to declare a PHP method to run on a configuration object during recipe application and any arguments that method needs to run.
In this tutorial, we will:
- Understand what config actions are
- Learn how to read and write config actions in a recipe's YAML file
- Explore common patterns like granting permissions and modifying displays
- Understand the difference between generic and type-specific actions
By the end of this tutorial, you'll be able to read config actions in recipes, understand when to use them versus configuration exports, and recognize common config action patterns.
Creating your own recipes lets you package and reuse features across your projects. By building a simple SEO-focused recipe from scratch, you'll learn what goes into a recipe, how to declare dependencies, and how to test your work.
In this tutorial, we will:
- Understand what belongs in a recipe versus what belongs in modules
- Create a recipe structure with proper metadata and dependencies
- Export and package configuration into a recipe
- Test the recipe by applying it to a second site
By the end of this tutorial, you'll be able to create your own recipes, package them properly with dependencies, and apply them to other Drupal sites.
Appendix A. Appendix
CourseChapter 8. Blocks
CoursePreface
CourseChapter 3. Installation
CourseChapter 14. Final Thoughts
CourseList of contributors involved in project management and guide-wide writing/editing tasks.