[2.0.0-alpha2] Formatters: functional feedbacks from alpha1

Created on 11 April 2024, 7 months ago
Updated 30 April 2024, 7 months ago

"For each" & "For all" field formatters

The 2 field formatters are very similar.

ComponentEachFormatter, we loop on each field item:

    foreach ($items as $field_item_index => $field_item) {
      $this->setComponentSettingsAltered(...)
      $build[] = $this->buildComponentRenderable(...);
    }

ComponentAllFormatter, no loop:

      $this->setComponentSettingsAltered(...)
      $build[] = $this->buildComponentRenderable(...);

For information, the current ui_patterns_field_formatters module
is not "proposing" ComponentEachFormatter when the field has a single value cardinality.

Anyway, let's discuss and clairfy what we want to achieve here:

  • Are we sure the 2 formatters have the same sources?
  • Are we also working at the field property level with ComponentAllFormatter?
  • ...

Simpler and shorter source naming

No need to recall the entity in the naming of sources: “Content article Image: Width", “Content article Image: Height"... We already know we are formatting a specific field from a specific content bundle.

The base plugin is enough: "Field property: Width", "Field property: Height"...

“Formatted value” source for slots is missing

We pick a field formatter, configure it and the result is the renderable we can put in a slot.

The context is not applied in Views

When using a field formatter in view fields, we see the properties of other fields. See 🐛 [2.0.0-alpha2] Field Formatters: views show all source plugins Needs work

Is it possible to set a generic "universal" system instead of just covering views' context?

🐛 Bug report
Status

Fixed

Version

2.0

Component

UI Patterns Field Formatters [2.x only]

Created by

🇫🇷France pdureau Paris

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