drupal-eca-recipe / article_tags
Provides tags on Article content. Includes the Article content type recipe and core's Tags taxonomy recipe.
Package info
gitlab.lakedrops.com/drupal/recipes/article_tags
Type:drupal-recipe
pkg:composer/drupal-eca-recipe/article_tags
Requires
- drupal-eca-recipe/article_content_type: *
- drupal/core: ^11 || ^12
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This recipe puts a field_tags entity reference field on Article content,
pointing at the Tags vocabulary. It adds the free-tagging autocomplete widget
to the Article form display and the tag labels to both the default and the
teaser view display, and it imports the taxonomy term view so that clicking a
tag leads somewhere useful.
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 tagged Article content in their examples. Rather than depend on something that exists in one major version and not the next, the library ships its own copy of the three recipes.
What it includes
Two recipes are applied before this one does its own work:
article_content_typefrom this library, which provides the Article content type, itsbodyandfield_imagefields and its displays. Its body field is a plaintext_longfield, the one deliberate difference from core's version.core/recipes/tags_taxonomyfrom Drupal core, which provides the Tags vocabulary thatfield_tagsreferences. That recipe still exists in Drupal 12, so it keeps the path form of its name.
This recipe's own composer.json requires
drupal-eca-recipe/article_content_type, so Composer installs that recipe
alongside this one. The Tags taxonomy recipe needs no package because it ships
with core.
Configuration that is already on the site is kept rather than overwritten, so an existing Article content type, an existing Tags vocabulary or an existing display survives applying this recipe untouched.
Including it from another recipe
recipes:
- article_tags
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 only
drupal-eca-recipe/article_tags in its composer.json;
drupal-eca-recipe/article_content_type follows through this recipe's
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/article_tags
drush recipe ../recipes/article_tags
# Without Drush:
cd web && php core/scripts/drupal recipe ../recipes/article_tags
drush cr