Adds configurable entity containers to entity types (for e.g. paragraphs)
Adds configurable entity containers to entity types (for e.g. paragraphs)
In Drupal 7 we noticed a couple of shortcomings with the
Paragraphs module (that are
still not solved in Drupal 8 AFAWK).
This package requires PHP 8.1 and Drupal 10.0 or higher. It can be
installed using Composer:
composer require wieni/wmcontent
Children and hosts can be entities of any type with a canonical route,
implementing Drupal\Core\Entity\ContentEntityTypeInterface
.
When updating a child entity, the changed time of the host entity is
updated as well.
Before you begin, make sure your user role has the administer
wmcontent
permission. After that, you can get started by creating a new
container. You can do this by going to/admin/config/wmcontent/containers
or by following the Structure >
WmContent > WmContent Containers menu link.
After creating the container, go to the (edit) page of a possible host
entity. A new tab should have appeared with the name of the container
you just created.
Clicking that link brings you to the master form, where you can add
children to and edit/delete/reorder children from this host.
If you use Display Suite to build your pages, you can use the
WmContent: Content blocks field to display the content of the children
entities on a host.
You can change the way wmcontent containers are rendered by overriding
the wmcontent
theme implementation.
If you build your pages manually using Twig templates, you can load the
children of a host using WmContentManagerInterface::getContent
.
All notable changes to this project will be documented in the
CHANGELOG file.
If you discover any security-related issues, please email
security@wieni.be instead of using the issue
tracker.
Distributed under the MIT License. See the LICENSE file
for more information.