Services
All ServicesDrupal DevelopmentBusiness TransformationIndustries
Products
AI Smart Quality AssistantPMO AI PlatformAll Products
Portfolio Company
About UsCareersFAQ
Blog Schedule a Consultation
Drupal 11

Drupal Recipes Explained: Reusable Site Building in Drupal 11

Laptop with code editor open on a desk

For years, reusing functionality between Drupal sites meant install profiles, distributions or a lot of manual clicking. Recipes, introduced in core in Drupal 10.3 and central to Drupal 11, change that: they package a feature as configuration and modules that you can apply to any site, at any time.

Recipes vs. install profiles and distributions

Install profile / distributionRecipe
When appliedOnly at installationAny time, on existing sites
Ongoing dependencySite stays tied to itNone; the site owns the result
CompositionOne per siteCombine many; recipes can include recipes

A recipe is applied once and then gets out of the way. The configuration it creates belongs to your site.

Anatomy of a recipe

recipes/event_content_type/
  recipe.yml        # what to install and which config actions to run
  config/           # config files to import (content type, fields, displays)
  content/          # optional default content

A simple recipe.yml for an Event content type:

name: 'Event content type'
description: 'Adds an Event content type with date and link fields.'
type: 'Content type'
install:
  - node
  - datetime
  - link
config:
  actions:
    user.role.content_editor:
      grantPermissions:
        - 'create event content'
        - 'edit own event content'

The files in config/ (for example node.type.event.yml and the field storage and field definitions) are imported when the recipe runs. Config actions are what make recipes special: instead of overwriting configuration, they make targeted changes to config that already exists, like granting permissions to an existing role.

Applying a recipe

# from the web root, with core's script
php core/scripts/drupal recipe ../recipes/event_content_type

# or with Drush
drush recipe ../recipes/event_content_type

Apply recipes on a development environment, review the result, then export configuration and deploy it like any other change.

Where recipes shine in organizations

  • Multi-site estates: ministries or universities with many sites can roll out a standard "news", "events" or "FAQ" feature consistently.
  • Agency accelerators: package proven features once and apply them on new projects in minutes.
  • Compliance baselines: SEO, accessibility or privacy settings packaged as recipes and applied everywhere.
  • Drupal CMS: the new Drupal CMS is itself built from recipes.

Good practices

  1. Keep recipes small and focused; compose bigger features from smaller recipes.
  2. Prefer config actions over shipping full copies of shared configuration.
  3. Store recipes in version control and test them on a fresh site in CI.
  4. Document what each recipe does and what it expects to exist.

Want a library of reusable recipes for your organization's sites? Our Drupal team can design it with you.

3P Technologies Engineering

Our team builds enterprise Drupal platforms, mobile apps and AI products from Amman, Jordan. About us

Keep reading

Related articles

All articles
Need an enterprise implementation?

Put our engineers on your project.

Our team specializes in Drupal 11/12 platforms, AI integration, performance engineering and multi-level data migrations.