Recipes
The base theme ships Drupal recipes that set a site up for the page builder in one command each: the modules, their configuration, the permissions of the Content editor role. They are in recipes/ of the theme and are applied by path (Drupal 11).
| Recipe | Installs | Sets up |
|---|---|---|
frame_builder | the base theme, Frame Builder, Media Library, Breakpoint, Responsive Image, Menu UI, Path, CKEditor | the Landing page content type, the Image media type, image styles and the responsive image styles Narrow, Wide and Hero (per breakpoint), the Basic HTML text format, the default theme, the Content editor role |
frame_builder_paragraphs | Paragraphs, Entity Reference Revisions, Paragraphs Library, Entity Usage | the paragraph types Text block (a starter) and From library (made by the builder for pages that use a paragraph of the library), a Usage tab on media, content and library items |
frame_builder_seo | Metatag, Metatag: Open Graph, Token | a Meta tags field on Landing page, in the page settings of the builder |
frame_builder_ai | AI, Frame Builder AI | the permission for the assistant |
frame_builder_full | all of the above |
Each of the last four applies frame_builder first, so one command is enough. A recipe never replaces configuration that exists: applying it to a site that has some of it adds the rest, and applying it twice changes nothing.
Apply
Recipes install modules, they do not download them. Get the code first:
# for frame_builder: nothing, it uses core and the theme
composer require drupal/paragraphs drupal/entity_usage # ..._paragraphs
composer require drupal/metatag # ..._seo
composer require drupal/ai # ..._ai, plus a provider, see belowThen, from the Drupal root (web/), with your subtheme installed:
drush theme:install my_theme
drush recipe themes/contrib/frame/recipes/frame_builder_full --input=frame_builder.theme=my_theme
drush crWithout drush: php core/scripts/drupal recipe themes/contrib/frame/recipes/frame_builder_full.
The theme input
The builder works only when the default theme of the site is Frame or a subtheme of it. The recipe makes the theme you name the default one:
--input=frame_builder.theme=my_theme | your subtheme, installed before (drush theme:install my_theme) |
--input=frame_builder.theme=frame | the base theme itself, to look around without a subtheme |
| no input | the default theme of the site is kept. Right when it is already your subtheme |
What you get
Media, breakpoints and responsive images
- The Image media type and the media library: image props and backgrounds of components pick from it.
- Image styles of 325, 650, 1300 and 2600 pixels (core's Standard responsive images recipe) with the responsive image styles Narrow and Wide, which let the browser choose by the width of the image (
sizes). - Hero (per breakpoint) (
frame_hero): one image style per breakpoint of the base theme, mobile, tablet and desktop (frame.breakpoints.yml). Use this kind for backgrounds: a background image gets one@mediarule per breakpoint. See Images.
A subtheme without its own <theme>.breakpoints.yml uses the base theme's breakpoints, in the preview of the builder and in SCSS. To offer only some image styles to editors, list them in the theme's image_styles token.
Revisions
Landing pages create a new revision on every save, and the role can view and revert them. Paragraphs are stored with Entity Reference Revisions: a layout names the revision of each paragraph it shows, so an old revision of a page shows its paragraphs as they were. See Paragraphs.
Reused paragraphs
A Paragraph block is saved to the library from its Library box. With this recipe the library is the one of the Paragraphs Library module (Content → Paragraphs), so the same paragraphs can be used in fields of other content types; see Reusing a paragraph.
Text block is a starter type with a title and a text; add your own under Structure → Paragraph types, each becomes a block.
Meta tags
The field is in the page settings (nothing selected in the editor). With the assistant, "fill the meta tags" writes them from the page. See AI assistant.
AI assistant
The recipe cannot choose a provider for you. After it:
composer require drupal/ai_provider_anthropic # or ai_provider_openai, ai_provider_ollama...
drush en ai_provider_anthropicthen add the key (Configuration → AI → Provider settings) and choose the default model for Chat (Configuration → AI → AI settings). Until then the AI panel says what is missing.
The Content editor role
Created by core's recipe if the site has none, and given: the builder, creating and editing landing pages and their revisions, media, URL aliases, the Basic HTML format, and with the other recipes the paragraphs library, usage statistics and the assistant. The assistant makes paid requests to your provider: take Use the AI assistant of the page builder away from the role if not every editor should have it.
Not in the recipes
- Your subtheme: create it with
frame new, see Build a site. - Content moderation: the builder saves with Publish and Draft and does not show workflow states.
- A provider for the AI module, and translation modules. For translations enable Content Translation and choose Synced or Independent on the content type, see Translations.
Write your own
A site recipe can build on these, for example to add your paragraph types:
# recipes/my_site/recipe.yml
name: 'My site'
type: 'Site'
recipes:
- ../web/themes/contrib/frame/recipes/frame_builder_paragraphs
install:
- my_theme
config:
strict: false
actions:
system.theme:
simpleConfigUpdate:
default: my_themePut the configuration of your paragraph types and fields into the recipe's config/ folder (export it from a site where you built them).