Add support for bundle specific configuration

Created on 20 February 2024, about 1 year ago
Updated 7 March 2024, about 1 year ago

Problem/Motivation

It would be good to support field per bundle configuration to take advantage of specific instances. For example, Photoswipe requires the bundle for certain settings such as target_bundle. This enables the selection of a specific image field on the target media entity.

Currently this is not possible with fieldblock.

There's a comment in FieldBlock.php:

   * A FieldBlock works on an entity type across bundles, and thus only has
   * access to field storage definitions. In order to be able to use formatters,
   * we create a generic field definition out of that storage definition.

Having access to the bundle would enable access to the specific FieldConfig rather than a generic field definition.

e.g.

$bundle_fields = $this->entityFieldManager->getFieldDefinitions($entity_type, $bundle);

Steps to reproduce

  1. Install fieldblock and photoswipe.
  2. Add a media reference field to a content type
  3. Place a content block in a region, selecting the reference field
  4. Under "Formatter" select "Photoswipe"
  5. Under "Formatter settings" the select list for "Image field of the referenced entity" will be empty.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇦🇺Australia imclean Tasmania

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024