Recipe naming best practices¶
A recipe's name is the folder in which the recipe.yml and it's dependencies are kept. A human readable name can be provided in the recipe.yml file along with a description. This information is used in other tools like Project Browser, and the Drupal CMS installer to present details to the end user.
Recipes are classified into types, which is also defined in the recipe.yml, but at this time, it is a documentation only specification, meaning the recipe system is not validating or parsing this data.
Core's recipe naming¶
As we converted Drupal core's standard install profile to recipes, we defined the list below of recipe types. They were defined in the recipe.yml files of core's recipes, and used to define the names/folder names of core's recipes.
Contrib recipe naming¶
Again, while there is no steadfast rule, you will find that a lot of the early adopters of recipe authoring are following the structure prefacing the type with a unique name.
Examples: fourkitchens/sous-paragraph-types kanopi/saplings-content-base-seo specbee/storm_cms_person
Purality¶
In many cases, a particular type can be used in either of two contexts: * Single. The recipe provides a single configuration item of the given type along with, in some cases, directly dependent configuration. * Multiple. Generally the recipe should not provide configuration directly but instead apply other recipes that do.
List of Recipe types¶
- 'Administration'
- Single:
- Naming pattern: none.
- Usage: adds configurations/modules related to site administration.
- Example: a
basic_shortcutsrecipe that provides a basic set of shortcuts for logged-in users.
- Single:
- 'Block type'
- Single:
- Naming pattern:
[type]_blockwhere[type]is the block content type. - Usage: provides a block type and associated configuration such as an entity view display.
- Example: a
basic_blockrecipe that provides abasicblock type.
- Naming pattern:
- Single:
- 'Comment type'
- Single:
- Naming pattern:
comment_[type]where[type]is the comment type. - Usage: provides a comment type and associated configuration.
- Example: a
comment_baserecipe that allows commenting on content.
- Naming pattern:
- Single:
- 'Contact form'
- Single:
- Naming pattern:
[id]_contact_formwhere[id]is the ID of a contact form. - Usage: provides a contact form.
- Example: a
feedback_blockrecipe that provides afeedbackcontact form.
- Naming pattern:
- Single:
- 'Content field'
- Single:
- Naming pattern:
[type]_[id]wheretypeis a content type and[id]is the ID of a field minus anyfield_prefix. - Usage: adds a field to a content type and adds the field to relevant entity field and form displays.
- Example: an
article_tagsrecipe that adds atagsfield to anarticlecontent type.
- Naming pattern:
- Single:
- 'Content type'
- Single:
- Naming pattern:
[type]_content_typewhere[type]is the content type. - Usage: provides a content type and associated configuration such as an entity view display.
- Example: an
article_content_typerecipe that provides anarticlecontent type.
- Naming pattern:
- Multiple:
- Naming pattern:
[descriptor]_content_typeswhere [descriptor] describes a group of content types. - Usage: applies other recipes that each provides a single content type.
- Example: a
standard_content_typesrecipe that applies the recipes that provide two commonly-used content types.
- Naming pattern:
- Single:
- 'Editor'
- Single:
- Naming pattern:
[id]_editorwhere[id]is the ID of the editor. - Usage: provides an editor.
- Example: a
basic_html_editorrecipe that provides abasic_htmleditor.
- Naming pattern:
- Multiple:
- Naming pattern:
[descriptor]_editorswhere [descriptor] describes a group of editors. - Usage: applies other recipes that each provides a single editor.
- Example: a
standard_editorsrecipe that applies the recipes that provide three commonly-used editors.
- Naming pattern:
- Single:
- 'Maintenance'
- Single:
- Naming pattern:
[type]_maintenance. - Usage: sets up modules recommended for site maintenance.
- Example: a
core_recommended_maintenancerecipe that adds modules like dblog.
- Naming pattern:
- Single:
- 'Media type'
- Single:
- Naming pattern:
[type]_mediawhere[type]is the media type. - Usage: provides a media type and associated configuration such as an entity view display.
- Example: an
audio_mediarecipe that provides anaudiomedia type.
- Naming pattern:
- Multiple:
- Naming pattern:
[descriptor]_media_typeswhere [descriptor] describes a group of media types. - Usage: applies other recipes that each provides a single media type.
- Example: a
standard_media_typesrecipe that applies the recipes that provide several commonly-used media types.
- Naming pattern:
- Single:
- 'Performance'
- Single:
- Naming pattern:
[type]_performance. - Usage: sets up modules for improved site performance.
- Example: a
core_recommended_performancerecipe that adds modules like page_cache.
- Naming pattern:
- Single:
- 'Responsive image'
- Multiple:
- Naming pattern:
[descriptor]_responsive_imageswhere[descriptor]describes a group of responsive image types. - Usage: provides two or more responsive image types. May also provide one or more image styles. Note: provisionally, in contrast with many other recipe types, multiple responsive image types are directly provided, rather than each being provided in its own recipe. Rationale: the responsive image styles are only usable as a set.
- Example: a
standard_responsive_imagesrecipe that provides two responsive image types and related image styles.
- Naming pattern:
- Multiple:
- 'Search'
- Single:
- Naming pattern:
[type]_search. - Usage: sets up search in the site.
- Example: a
content_searchrecipe that adds page that can search site content.
- Naming pattern:
- Single:
- 'Site'
- Single:
- Naming pattern: none really, just
[name]where[name]is a machine name for the site recipe. - Usage: the type 'Site' is a special case that allows such Drupal recipes to be listed on the installer.
- Example: an
standardrecipe that provides a standard site with commonly used features pre-configured.
- Naming pattern: none really, just
- Single:
- 'Taxonomy'
- Single:
- Naming pattern:
[id]_taxonomywhere[id]is the ID of a taxonomy vocabulary. - Usage: provides a taxonomy vocabulary. May also provide a field storage for an entity reference field referencing taxonomy terms for use with the vocabulary.
- Example: a
tags_taxonomyrecipe that provides atagsvocabulary.
- Naming pattern:
- Single:
- 'Text format'
- Single:
- Naming pattern:
[id]_formatwhere[id]is the ID of the format. - Usage: provides a text format.
- Example: a
basic_html_formatrecipe that provides abasic_htmlformat.
- Naming pattern:
- Single:
- 'Text format editor'
- Single:
- Naming pattern:
[type]_format_editorwhere[type]is the text format type. - Usage: sets up a text format along with an editor.
- Example: a
basic_html_format_editorrecipe that adds "Basic HTML" text format along with WYSIWYG editor and related configuration.
- Naming pattern:
- Single:
- 'Theme'
- Single:
- Naming pattern:
[name]_[type]where[name]describes the theme and[type]indicates whether the theme is a front-end theme or an admin theme. - Usage: sets up an admin or front end theme on the site.
- Example: a
core_recommended_admin_themerecipe that adds "Claro" as the administrative (backend) theme.
- Naming pattern:
- Single:
- 'User role'
- Single:
- Naming pattern:
[id]_rolewhere[id]is the ID of the role. - Usage: provides a user role. Typically the role is provided without any permissions, as permissions will be added by other recipes via config actions.
- Example: an
administrator_rolerecipe that provides anadministratoruser role.
- Naming pattern:
- Multiple:
- Naming pattern:
[descriptor]_roleswhere [descriptor] describes a group of roles. - Usage: applies other recipes that each provides a single role.
- Example: a
standard_rolesrecipe that applies the recipes that provide two commonly-used roles.
- Naming pattern:
- Single:
- 'User type'
- Single:
- Naming pattern:
user. Core only supports a single user type, so it's not foreseen that more than one recipe of this type is needed. - Usage: provides configuration for core's
useruser type. - Example: a
userrecipe.
- Naming pattern:
- Single:
- 'Users'
- Single:
- Naming pattern:
user_[action]where[action]is the update done by the recipe on user accounts. - Usage: adds additional features to user accounts.
- Example: a
user_picturerecipe that adds the ability for user accounts to have pictures (avatars).
- Naming pattern:
- Single:
- 'Workflow'
- Single:
- Naming pattern:
[id]_workflowwhere[id]is the ID of the workflow. - Usage: provides a workflow.
- Example: a
editorial_workflowrecipe that provides aneditorialworkflow.
- Naming pattern:
- Single: