drupal-eca-recipe / page_content_type
Provides the Basic page content type and related configuration. Use <em>basic pages</em> for your static content, such as an 'About us' page. The body is a formatted long text field without a summary.
Package info
gitlab.lakedrops.com/drupal/recipes/page_content_type
Type:drupal-recipe
pkg:composer/drupal-eca-recipe/page_content_type
Requires
- drupal/core: ^11 || ^12
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This recipe creates the Basic page content type with the configuration a site
normally expects around it: the body field, the page form display including
the URL alias widget, and the default and teaser view displays. It also imports
the node view modes and node actions that the Standard profile used to install,
so a site built from Minimal ends up with the same Basic page experience.
Why this recipe exists
Drupal 11.4.0 dropped the Article and Basic page content types from the
Standard profile, so new sites no longer get them out of the box. See
https://www.drupal.org/node/3590571. The follow-up issue
https://www.drupal.org/project/drupal/issues/3608069 restored the
article_content_type, page_content_type and article_tags recipes, but on
the 11.x branch only. Drupal 12 ships no successor: those recipes are gone and
nothing in core replaces them.
Models in the ECA library use a Basic page content type in their examples. Rather than depend on something that exists in one major version and not the next, the library ships its own copy. This recipe is that copy: the core 11.x recipe, with one deliberate difference in the body field.
The body field
Core's version of this recipe gives body the text_with_summary field type,
which offers a separate summary alongside the main text. Drupal 12 removed that
field type from core, see https://www.drupal.org/node/3568381. It lives on in
the contributed Text With Summary module,
https://www.drupal.org/project/text_with_summary.
This recipe uses plain text_long from the text module instead, and never
installs Text With Summary. What follows from that:
- The widget is
text_textareawith nine rows, nottext_textarea_with_summary. - The teaser formatter is
text_trimmedtrimmed to 600 characters, nottext_summary_or_trimmed. - Editors maintain a single formatted long text value and no separate teaser text.
Article and Basic page share the same body field storage, and the Article
content type recipe ships a byte-identical copy of it, so applying both recipes
is fine in either order; configuration already on the site that matches what
this recipe ships is kept, not overwritten. A site whose body storage is of
another type, typically text_with_summary from a Standard install predating
Drupal 11.4, cannot apply this recipe: the storage is compared strictly, the
recipe stops before creating anything, and a field's type cannot be changed once
it exists. Such a site keeps its own content types and does not need this recipe.
Including it from another recipe
recipes:
- page_content_type
The bare name resolves to a sibling directory of the recipe being applied,
which is where Composer installs drupal-recipe packages. Composer does not
process the recipes: list on its own, so the including recipe requires
drupal-eca-recipe/page_content_type in its composer.json. Modeler API's
recipe export writes that requirement since
issue #3588524 in
releases after 1.1.7; a hand-written recipe adds it itself.
Installation
composer require drupal-eca-recipe/page_content_type
drush recipe ../recipes/page_content_type
# Without Drush:
cd web && php core/scripts/drupal recipe ../recipes/page_content_type
drush cr