You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filed by Claude (Claude Code), writing on behalf of @DanielJackson-Oslo, whose site ran into this. The specifics below come from reading craftcms/ckeditor 5.6.1 and Craft 5.10.8.1 locally and building a working prototype — please have a human or a second model verify them. The underlying need is real: the prototype is in daily use on our site.
Problem
A CKEditor field with many nested entry types renders them as one flat, unsorted list — both in field settings and in the “Add nested content” (+) menu. We have 14, so authors scan a single 14-item column to find a block.
Ask
Support EntryType::$group for CKEditor fields, the way Matrix already does:
Field settings — render Craft's Craft.GroupedEntryTypeManager (the Matrix group manager: add/rename groups, drag entry types between them, drag groups to reorder) instead of the flat component select.
“Add nested content” menu — emit type: 'group' list item definitions so CKEditor renders ListItemGroupView subheaders. The bundled CKEditor 5 (48.x) supports this already.
FieldSettingsController::actionApplyEntryTypeIndicators() rebuilds a chip's config from toArray(['id', 'name', 'handle', 'expanded']), so group is dropped on every indicator round trip — on init, and on expand/collapse.
_field-settings.twig polls #entry-types for a single data('componentSelect') to drive the image entry type field; a grouped layout has one select per group.
CkeEntryTypeSelectInput and Craft.GroupedEntryTypeSelectInput are sibling subclasses of Craft.EntryTypeSelectInput, so a grouped CKEditor select needs both sets of behaviour. Instantiating the plugin's select and then replacing it with a grouped one also left a drag handler that threw at ComponentSelectInput.js:133 (Cannot read properties of null (reading '$targetItem')) on the next drag; we worked around it by never instantiating the plugin's select in the grouped layout. We didn't chase the root cause, so treat that one as an observation rather than a diagnosis.
Related: craftcms/cms#19379 — three details that currently tie the group manager to Matrix.
Problem
A CKEditor field with many nested entry types renders them as one flat, unsorted list — both in field settings and in the “Add nested content” (+) menu. We have 14, so authors scan a single 14-item column to find a block.
Ask
Support
EntryType::$groupfor CKEditor fields, the way Matrix already does:Craft.GroupedEntryTypeManager(the Matrix group manager: add/rename groups, drag entry types between them, drag groups to reorder) instead of the flat component select.type: 'group'list item definitions so CKEditor rendersListItemGroupViewsubheaders. The bundled CKEditor 5 (48.x) supports this already.Screenshots
Before
After: Grouped menu
After: Field settings group UI
Notes from the prototype
Four things any implementation runs into:
Field::entryType()builds usages withoutoriginal, andEntryType::getUsageConfig()only writesgroupwhenoriginalis set — so the group silently doesn't persist. (Craft side: Grouped entry type manager is hard to reuse outside Matrix (3 small blockers) cms#19379.)FieldSettingsController::actionApplyEntryTypeIndicators()rebuilds a chip's config fromtoArray(['id', 'name', 'handle', 'expanded']), sogroupis dropped on every indicator round trip — on init, and on expand/collapse._field-settings.twigpolls#entry-typesfor a singledata('componentSelect')to drive the image entry type field; a grouped layout has one select per group.CkeEntryTypeSelectInputandCraft.GroupedEntryTypeSelectInputare sibling subclasses ofCraft.EntryTypeSelectInput, so a grouped CKEditor select needs both sets of behaviour. Instantiating the plugin's select and then replacing it with a grouped one also left a drag handler that threw atComponentSelectInput.js:133(Cannot read properties of null (reading '$targetItem')) on the next drag; we worked around it by never instantiating the plugin's select in the grouped layout. We didn't chase the root cause, so treat that one as an observation rather than a diagnosis.Related: craftcms/cms#19379 — three details that currently tie the group manager to Matrix.
Happy to open a PR if you'd take one.