Unlocking Drupal Recipes: Instantly Boost Your Website's Features

Nov 21 2024

Authored by Nadiia Nykolaichuk.

An exciting recipe is brewing in the Drupal kitchen. Picture a cookbook filled with delightful dishes, each requiring just one simple step. Similarly, Drupal users will soon enjoy the ability to add valuable functionalities to their websites with a single click, thanks to Recipes

We are delighted to announce that Bryan Sharpe, our Software Architecture Director, is a contributor to the development of Recipes. And we are happy to share with our readers some of the latest exciting examples of Drupal Recipes that were demoed at DrupalCon Barcelona 2024. Let’s dive in!

Drupal Recipes: a quick introduction

While every website has its own unique charm and variety, there are specific sets of features that are often in demand — a blog, an event section, analytics, SEO, and so on. Imagine if these features were pre-packaged and ready to use without any hassle, complete with the right modules, configuration, dummy content, and documentation for a seamless start.

That is the essence of Drupal Recipes! As Drupal’s creator Dries Buytaert put it at DrupalCon Barcelona’s Driesnote“Recipes bundle years of expertise into repeatable, shareable solutions.” Since 2001, Drupal has developed many outstanding features, and there’s no need to reinvent the wheel to enable users to experience Drupal’s capabilities for specific goals. 

The Events Recipe includes modules, configuration, content, and documentation

Recipes vs. distributions and install profiles in Drupal

Wait, haven’t we heard about pre-packaged sets of features for specific types of websites before? That’s right! Drupal distributions (like Opigno LMS, Commerce Kickstart, Open Social, etc.) and Drupal install profiles (like “Minimal,” “Standard,” and “Umami”) have been around for years.

However, recipes have advantages over distributions or install profiles, and Martin Anderson-Clutz and Mark Casias highlighted them again at their “Drupal Recipes Initiative Update” session at DrupalCon Barcelona:

  • Distributions and install profiles: are difficult to update, can’t be mixed and matched, can’t be added after the project starts, and are hard to discover before you install Drupal due to lack of promotion and maintenance.
  • Recipes: are composable from other recipes, are easy to share, are applied to your website as configuration in a lightweight way (not installed), do not lock sites into the limitations of specific distributions or install profiles, can install modules but don’t have code of their own.

The advantages of Drupal Recipes

Recipes at the heart of Drupal development

  • One of the key ingredients in Drupal CMS

Recipes are actively being prepared for use by all Drupal users but one of their most specifically interesting implementations is in Drupal CMS. “Drupal CMS” is the officially assigned name for a next-generation CMS in the works that has already received a lot of spotlight under the codename “Starshot” and is specifically tailored to empower non-technical people. Save the date of January 15, 2025, which is Drupal’s birthday because that’s when the first release of Drupal CMS is planned.

Recipes will be one of the cornerstones of Drupal CMS, fully sharing its philosophy of providing users with simple, one-click experiences. For example, during the installation of Drupal CMS, there will be an option to add specific sets of features based on their goals. At any later point, users will also be able to search for and add desired recipes via the Drupal admin dashboard using Project Browser. We’ll see all this and more in the demos below.

  • A top-notch innovation in Drupal core

At the same time, the “standard” Drupal that we all used to know is not going anywhere and will keep developing under the name “Drupal core.” Drupal core lies at the basis of the new Drupal CMS, and Recipes will be available for it, too.

An experimental Recipe API was added to Drupal 10.3 and Drupal 11. Currently, Recipes in Drupal core can primarily be applied through the command line interface but work is underway to integrate Recipes into the Drupal core admin interface soon. Just stay tuned and keep your website updated — and our team is here to assist you with both.

Examples of Drupal Recipes: demo time!

Adding recipes to a website

  • With a click of a button during Drupal CMS installation

In the Driesnote demo, we can see the above-mentioned Drupal CMS installed after just clicking “Download Drupal.” The installer downloads Drupal and starts it in the user’s browser, with no need for web servers, PHP, hosting companies, etc.

The next thing the installer asks is “What are your goals?” offering you to click the following buttons:

  • Multilingual support
  • Accessibility tools
  • Events
  • Advanced SEO tools

You select the needed recipe and just click “Next,” and this recipe is applied to the Drupal website. It’s worth noticing the simplicity and the user-friendliness of the interface — the language is non-technical, and it’s clear what to do. There is also a message that this decision does not bind the user and they are free to change their mind later. 

Choosing recipes based on goals during Drupal CMS installation

We can see four options available in the installer but Dries’ demo shows there currently are 14 recipes in the works such as:

  • Events, SEO, Blog, Data Privacy, Basic Multilingual Content, Content Publishing Workflows, Accessibility Tools, Media, Advanced Search, Analytics, Dashboard, Marketing, Contact Form, and AI.

What Drupal Recipes are currently in the works

  • With a click of a button via Project Browser

One of the greatest news is that Recipes are supported by Project Browser — yet another ground-breaking invention of Drupal’s best minds, allowing users to discover and install modules from the Drupal admin interface. So whenever you need to add recipes, you’ll be able to go to the “Extend” page, find the recipes you need, and click “Install.”

Adding Drupal recipes via Project Browser

  • Via the command line

Martin Anderson-Clutz and Mark Casias also demoed the process of adding recipes. This way should be more interesting for tech-savvy people because they used the Drush command-line tool. The required step after this is to clear the cache. In their demo, they were adding a recipe not to Drupal CMS but to the “traditional” Drupal core. 


Adding Drupal recipes via the command line

Examining the Events Recipe: what’s included

As we can see on Dries’ demo of the Events Recipe in Drupal CMS, by applying this recipe, you get a pre-configured “Upcoming Events” section on the website.

The “Upcoming Events” section created by the Events Recipe

The “Add an event” button opens the content creation form with all the information an event should have. For example, there is a date and time widget for setting the start date, end date, and duration of the event. We can also see the “Where” field where the user can choose the location from the taxonomy vocabulary.

 

The event creation form with a date widget, taxonomy, and more

You can fill out the body field with the description of the event. Thanks to the integration with Media Library, it’s possible to drop multimedia like a video to the newly created event.

As the event is saved, you'll notice the integration of a map widget, which displays the selected location.

An example of an event created on the basis of the Events Recipe

Furthermore, there is a pre-built event calendar where you can drag and drop the events around to change their time. As you can see, it’s built on one of the top modules for “Calendar creation in Drupal” that we described in an earlier article. 

A pre-built event calendar

There is also a nice documentation page at your fingertips with all the needed information about using the Events Recipe.

The handy documentation page about the Events Recipe

Examining the SEO Tools Recipe: what’s included

Next in Dries’ demo of using recipes in Drupal CMS, we see that with the SEO Tools Recipe applied, a dozen modules and various settings for Drupal search engine optimization are added to the website. They are easy to reach via the SEO dashboard which offers the links to the key SEO features and instructions on using them.

This collection is a goldmine for any SEO manager or marketer focused on SEO. It includes the XML sitemap, meta tags and schema.org defaults, robots.txt, URL redirect settings, URL alias patterns for possible automatic generation of SEO-friendly URLs, and much more.

The dashboard with Drupal SEO features provided by the SEO Tools Recipe

You can take an interactive guided tour helping you get acquainted with each section of Drupal SEO tools.

A guided tour of Drupal SEO Tools

One of the features included with the recipe is SEO checklist which helps you set up your website with search engines and submit your XML sitemap.

The SEO checklist section

On the content creation form, you’ll also find the SEO section with useful tips to optimize the content. This includes the SEO analysis from the Real-time SEO module which we described in more detail. 

Content analysis with SEO instructions on the content creation form

What’s inside a recipe? A more tech-savvy look

Let’s see how the ingredients of a recipe look from a developer’s perspective. At their session, Martin and Mark demonstrated and explained the structure of a recipe. Here are the main folders and files included with it:

1) Recipe.yml. This is the key file in a recipe, and it functions somewhat similarly to the info.yml file in a Drupal module or theme. This recipe.yml file defines the key details such as:

  • other recipes you want your recipe to apply
  • the modules and themes you want your recipe to install
  • specific configurations from those modules and themes — like content types, fields, views, or permissions — that you want to be installed

2) Composer.json. Also, like with other modules and themes, you’ll have a composer.json file where you can declare the dependencies that should be pulled into your overall codebase.

3) Config (optional). This is a folder for the configuration that you want to import.

4) Content (optional). This is a folder for the default content that you want your recipe to come packed with. 


The structure of a Drupal recipe

Martin and Mark also showed an example with the folder structure of the real-world “Alerts” recipe that is found on drupal.org.

An example of a real-word Drupal recipe’s folder structure

An extra secret: installing Drupal from a recipe

It’s great news that Drupal can now be installed from a recipe. For example, the “Standard” Drupal profile which is the most popular choice during Drupal installation, can be installed with a single command, just like in Martin and Mark’s demo:

php core/scripts/drupal quick-start core/recipes/standard

Installing Drupal from a recipe via the command line

Final thoughts

The above examples of how Recipes work in Drupal are indeed inspiring. Recipes are a step towards a Drupal of the future where innovation is baked into every configuration and where ideas come to life with just a few clicks. It’s a future of re-usable and shareable solutions that make every project faster and smarter. We’ll keep you updated on the latest Drupal gems and will be happy to assist you in making your website ready for them!

Learn from us
Sign up and receive our monthly insights directly in your inbox!

Subcribe to newsletter (no spam)

Fields