Search by

drupal / cafe

Drupal-Infrastructure

A site template for an independent cafe: readable HTML menus with prices, opening hours and dated changes, visit information, stories, people and a catering inquiry. Demonstrated by Harbor Hollow Cafe.

Package info

git.drupalcode.org/project/cafe.git

Homepage

Type:drupal-recipe

pkg:composer/drupal/cafe

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

1.0.1 2026-11-23 12:30 UTC

This package is auto-updated.

Last update: 2026-11-23 12:33:02 UTC


README

A Drupal CMS site template for an independent cafe, coffee shop, bakery or small restaurant. Visitors find the menu with every price as text, the opening hours and the days that differ, how to visit, stories, the people, and a catering inquiry. It ships the content model, the pages and a demonstration site for a fictional cafe, Harbor Hollow Cafe, in Harbor Hollow on Saltmarsh Island.

The front end is the Coffeehouse theme, and every landing page is built in Drupal Canvas. A recipe cannot ship a theme, so Coffeehouse is a separate Composer package that this recipe requires.

Cafe is built on the Drupal CMS base: it applies no other recipe. It installs the modules and sets the config actions of the base and of the recipes the base applies, and ships a copy of their configuration, without the Drupal CMS Utility page content type and its privacy policy node. The privacy notice is a Canvas page at /privacy, and Klaro links to it.

There is no custom PHP module. Hours and dietary guidance are read from settings by the theme, and site rules use ECA.

What ships

  • Content types (6): menu, menu item, price option, service, story and person. A menu item has a description, a price display (amount, "From" a minimum, or "Ask for a price"), a base price and currency, availability (available, seasonal, unavailable), a featured flag, ingredient and cross-contact notes, dietary labels, declared allergens and a dietary review status and date. A price option is one labeled price (such as Single or Double) for one item.
  • Taxonomies (3): menu section (each points to one menu; term weight orders the sections), dietary label and declared allergen.
  • Config Pages (3): Cafe settings (contact email, address fields, time zone, weekly opening hours and dated changes with Office Hours, access information), Menu settings (primary menu, currency, dietary guidance) and Service settings (catering email and guidance, optional external ordering and reservation links, fallback text).
  • Canvas: 13 pages (home, menu, visit, about, catering, stories, contact, search, privacy, accessibility, credits, site features and site components), full content templates for menus, menu items, services, stories and people, and one site default page template with the header and footer.
  • Search (Drupal CMS Search): a Search API index of content and Canvas pages at /search, updated as content is saved. Price options and items whose section or menu is unpublished or inactive are left out. Search and the XML sitemap fill on the first page request after install (see Installing).
  • Views (7): active menus, a menu's items grouped by section, featured items, the item on its own page, services, stories and people.
  • Webforms (2): the Drupal CMS contact_form, adjusted for the cafe with config actions, and catering_inquiry. Each sends mail to the cafe and a receipt to the visitor, and ALTCHA protects both. Submissions are kept for 90 days.
  • ECA rules: a base price is required for the Amount and From displays; price options and items of an unpublished or inactive menu answer 404 at their own address; cron refreshes cached hours at most hourly.
  • SEO: the Drupal CMS SEO fields on every content type, Metatag and Open Graph defaults with a share image on every page (the SEO image, then the content image, then the Cafe settings share image, then the theme's share.png), Schema.org data (CafeOrCoffeeShop and WebSite on the front page, Article for stories, Person for people), an XML sitemap, Pathauto patterns, redirects and breadcrumbs on detail pages.
  • Editorial: the Drupal CMS editorial workflow, scheduled publishing on every content type, autosave and trash. Content forms use tabs (Content, Details, and for menu items Price and Dietary), with the SEO tab last, and every field has help text.
  • Image media has caption, credit and credit link fields.
  • Roles: the Drupal CMS administrator and content editor. Content editors manage the cafe content, the settings pages and inquiry results, and they are the only role with the admin toolbar, Coffee search and the administration theme.
  • Demonstration content: 2 menus, 6 sections, 18 items, 6 price options, 2 services, 4 stories and 3 people, from the Saltmarsh fixture register, with 34 generated photographs of fictional subjects (see ASSETS.md).

Requirements

  • PHP 8.3 and Drupal core 11.4 or later, in a Drupal CMS 2.2 project (drupal/cms).
  • Drupal Canvas 1.11 or later and Office Hours 1.29 or later.
  • The Coffeehouse theme (drupal/coffeehouse).

Installing

With the Drupal CMS installer:

composer create-project drupal/cms my-site
cd my-site
composer require drupal/cafe

Open the site in a browser and choose Cafe on the "Choose a template" step.

With Drush:

drush site:install ../recipes/cafe --site-name="Harbor Hollow Cafe" -y

Pass --site-name; without it, drush site:install overwrites the recipe's site name.

Search and the XML sitemap fill on the first page request after install. Drupal CMS includes Automated Cron, and a new site has never run cron, so the first visit runs it: cron indexes the demonstration content and writes the sitemap. On a site that already ran cron, run drush cron once.

Installing before the first release

Until Cafe and Coffeehouse have tagged releases, install from the repositories. This is the setup of the verification site. It uses DDEV; the folder names are examples.

  1. Clone both repositories side by side, on their development branches, and create a Drupal CMS project beside them:

    mkdir cafe-work && cd cafe-work
    git clone -b main git@git.drupal.org:project/cafe.git cafe
    git clone -b 1.0.x git@git.drupal.org:project/coffeehouse.git coffeehouse
    mkdir site-cms && cd site-cms
    ddev config --project-type=drupal11 --docroot=web
    ddev start
    ddev composer create-project drupal/cms
    

    drupal/cms ships its own .ddev/config.yaml; set the project name in it afterwards and run ddev restart.

  2. Mount the clones into the web container, so Composer's relative path repositories resolve there as on the host. Save this as .ddev/docker-compose.sources.yaml, then run ddev restart:

    services:
      web:
        volumes:
          - "../..:/var/www/sources:cached"
          - "../../cafe:/var/www/cafe:cached"
          - "../../coffeehouse:/var/www/coffeehouse:cached"
    
  3. Add the clones as path repositories, before the drupal repository in composer.json, and require them:

    {"type": "path", "url": "../cafe", "options": {"symlink": true}},
    {"type": "path", "url": "../coffeehouse", "options": {"symlink": true, "versions": {"drupal/coffeehouse": "1.0.x-dev"}}}
    
    ddev composer require "drupal/cafe:@dev" "drupal/coffeehouse:1.0.x-dev as 1.0.0" -W
    

    Composer places the recipe at recipes/cafe.

  4. Install the site and log in:

    ddev drush site:install ../recipes/cafe --site-name="Harbor Hollow Cafe" -y
    ddev launch $(ddev drush user:login)
    

The demonstration site sends mail to DDEV's Mailpit (ddev mailpit).

Adapting it for your cafe

docs/adaptation-guide.md walks through it step by step. In short:

  1. Edit Cafe settings at /admin/config/cafe/cafe-settings: contact email, phone, address, time zone, weekly hours, dated changes and access information. The hours panel, the footer, the contact page and structured data read from it.
  2. Set the site name and slogan at /admin/config/system/site-information, and the time zone at /admin/config/regional/settings.
  3. Edit Menu settings and Service settings (/admin/config/cafe/menu-settings, /admin/config/cafe/service-settings), then replace the menus, items and price options as the menu editor guide explains.
  4. Replace the logo at /admin/appearance/settings/coffeehouse, and the colors and fonts as the theme's CUSTOMIZING.md explains.
  5. Set the default share image on Cafe settings, 1200 by 630 pixels, and replace share.png in the Coffeehouse theme folder. Pages without their own image use the settings image when shared; without it, they use share.png.
  6. Change the organization type in the front page Metatag defaults at /admin/config/search/metatag to the closest schema.org type, such as Bakery or Restaurant.
  7. Replace the demonstration stories, people and services. Give every image alt text, a caption where it helps, and a credit with a credit link for anything you did not make.
  8. Rewrite the About, Accessibility, Privacy and Credits pages in Canvas.
  9. Edit the menus at /admin/structure/menu.
  10. Set up mail delivery (see Mail).

The operator review checklist lists what the owner checks before the site goes live. Before launch, add what a host or the cafe needs and the template leaves out: analytics with the site's own container ID, upload virus scanning, a launch checklist and HTTP header hardening.

Mail

The recipe does not set a sender address or a mail transport. Set them in settings.php or environment variables, and send a test message and a test inquiry to a mailbox the cafe reads, with SPF and DKIM passing, before the site goes live. Recipients come from Cafe settings and Service settings only; a form cannot change them.

Accounts and roles

Editors get the content_editor role. An account without an editor role sees the public site only: no admin sidebar, no Coffee search box and no administration theme.

Images

The demonstration site shows 34 generated photographs of fictional subjects: the home, visit, menu, catering, about and stories page images, the menu and menu item images, services, stories, people, the default share image and the phone menu card. Replace them with the cafe's own. Each image is an Image media item with alt text, an optional caption, and a credit and credit link for anything the cafe did not make. Menu item images show the named dish only; an image never stands for a dietary label or an allergen declaration.

Known issues

  • The default share image, share.png, shows the demonstration cafe's name. Replace it for your cafe.
  • Structured data lists the address, telephone and a contact point with the email from Cafe settings. It does not list opening hours.
  • The demo content has no dated changes (closures or short days). Office Hours 1.29.0 logs the PHP warning Undefined array key "day_delta" when they import as default content, and the install test fails on it. They return to the demo content once Office Hours fixes it. Editors can still add dated changes in Cafe settings.
  • Three components ship turned off and no page uses them: Card pricing, Card testimonial and Site logo. Cafe lists prices on menu items, has no testimonials, and shows the logo in the navigation bar. Turn them on in Canvas if your cafe needs them.

Demonstration cafe

Harbor Hollow Cafe is a fictional independent cafe in Harbor Hollow, on the fictional Saltmarsh Island. Its menus, prices, hours and people are invented, its ingredient information has not been reviewed, and it has no street address or phone number. Online ordering and table reservations are switched off.

Verified versions

PackageVersion
drupal/cms2.2.9
drupal/core11.4.12
drupal/canvas1.12.0
drupal/office_hours1.29.0
drupal/coffeehouse1.0.x-dev