Cardinality constraint for slots

Created on 31 August 2025, 6 days ago

Problem/Motivation

With ✨ Allow SDCs to specify what components are allowed in its respective slots Active Core issue, we may introduce two new properties in slot definitions: minimum and maximum with a strictly positive integer value: Enforce a lower/maximum limit on the number of children

So, both UI Patterns 2 (in the slot part of the component form) and Display Builder will need to add a way to leverage those properties. This may happen late 2025 / early 2026.

However, on Display Builder side, we need a similar mechanism right now, related to 📌 [1.0.0-alpha2] Add content display overrides Active and 📌 Improve content display overrides Active .

Because the cardinality of the UI Patterns Soure field (" Allowed number of values " from the Field API) is acting like the maximum keyword proposed in the Core issue, on the root dropzone (which is a slot of a "virtual" component).

Proposal

  • Limit the number of sources we can put in the root dropzone by checking the cardinality of the content field
  • But do it in a generic way, by introducing in Display Builder a generic mechanism of slot limitation (minimum, maximum... open to other ones)
  • If something must be done at UI Patterns level, go for it, to avoid duplicating logic later when UIP2 will need the same mechanism
📌 Task
Status

Active

Version

1.0

Component

display_builder_entity_view

Created by

🇫🇷France pdureau Paris

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

Comments & Activities

Production build 0.71.5 2024