Repository navigation
No admin UI to assign a plugin fieldWidget to a field in Content Types (seed/SQL only)
#3874
DavidPivert
started this conversation in
Ideas
Replies: 1 comment
|
Thanks for the clear write-up, @DavidPivert! You're right that the field editor has no widget picker yet. Until it does, |
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.
Summary
A plugin can register a field widget via
admin.fieldWidgets(native format now works since #1483). The widget renders correctly in the entry editor once a field'swidgetis set to"pluginId:name". However, there appears to be no way to set thatwidgetfrom the admin UI: the Content Types field editor offers no widget picker.In the admin bundle,
fieldWidgetsis only ever consumed to resolve a widget at render time:There is no code building a list of available widgets (filtered by the field's
type) for the schema editor. So the only ways to assign a plugin widget to a field are:{ "slug": "seo", "type": "json", "widget": "pluginId:name" }), or_emdash_fields.widgetdirectly (SQL/migration).Steps to reproduce
admin.fieldWidgets: [{ name: "x", label: "X", fieldTypes: ["json"] }].jsonfield.Expected
When editing a field whose
typeis in a registered widget'sfieldTypes, the field editor offers a "Widget" selector listing the matching plugin field widgets (label +pluginId:name), so a non-technical editor can assign it without touching seed/SQL.Actual
No such selector. The field saves with an empty
widget, so the default editor for that type is used. The only way to wire the plugin widget is seed or a direct DB write.Question / possible intent
Is seed-only assignment by design (matching how
@emdash-cms/plugin-field-kitdocuments usage — seed"widget": "field-kit:list")? If so, a note in the docs plus surfacing the availablepluginId:namevalues somewhere in the admin would help. If not, a widget picker in the field editor would close the loop between "plugin registers a widget" and "editor can use it".Environment
fieldWidgetsforjson.All reactions