Repository navigation
Nested repeaters in blocks and repeater fields (native and plugin) #5050
diogoascarneiro
started this conversation in
Ideas
Replies: 1 comment
|
Design PR #5051 proposes |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Problem
A repeater is a list of rows, but a row can only hold single values. It can't hold its own list. That blocks shapes like FAQ groups with questions, footer groups with links, rate cards (category → product → rate), and pricing plans with groups of features.
It is the same gap on three surfaces:
blocksfieldrepeaterfieldsrepeaterelementAllowing a repeater sub-field to be another repeater, up to two levels deep, would close the gap on all three with one rule. Stored data would stay plain arrays in rows, with no migration and no new query on any route.
Use case
Any site that models content as blocks hits this when an item has a list of its own: FAQ groups with questions, footer groups with links, rate cards (category → product → rate), pricing plans (plan → feature group → feature). Developers who define those block types and the editors who fill them in are affected, on sites using native blocks and on sites using plugin Portable Text blocks. Of the list-in-list shapes I have run into, most need one level of nesting and a few need two.
EmDash's own marketing template would also benefit from this update: its pricing
featuresand the Text and imagepointschecklist are multiline text because repeaters can't nest. It also matters that plugin and native blocks follow one rule. If the two disagree on depth, moving a shape from a plugin block to a native block means redesigning its data.The two designs:
@emdash-cms/blockstypes and validation plus a one-line seed in the admin dialog, and no server or stored-data change. Prototype: https://github.com/diogoascarneiro/emdash/tree/feat/nested-block-kit-repeaterssubFields,minItemsandmaxItems. Definitions come from seed files, the REST API, MCP and the admin field editor. Validation, media usage, datetime and URL handling, site transfer and seed export follow the nested rows. Older runtimes treat a nested definition as an unsupported type and refuse writes, so the server and admin should upgrade together. Prototype with tests on SQLite and PostgreSQL: https://github.com/diogoascarneiro/emdash/tree/feat/native-nested-repeatersThings worth knowing before replying:
""instead of[]. Site components should treat a missing or non-array value as an empty list.Questions:
Current workarounds
feature1andfeature2. The number of rows is fixed when the schema is written.A plugin can cover part of this: its own Portable Text blocks can use Block Kit repeaters today, but only one level deep. That is what #4979 extends. A plugin can't add nested lists to native block types or collection repeater fields.
Your involvement
All reactions