Skip to content

[6.x] New field page to Inertia + Vue#19215

Draft
brianjhanson wants to merge 4 commits into
6.xfrom
feature/inertia-field-edit
Draft

[6.x] New field page to Inertia + Vue#19215
brianjhanson wants to merge 4 commits into
6.xfrom
feature/inertia-field-edit

Conversation

@brianjhanson

Copy link
Copy Markdown
Contributor

Replaces the Twig-based settings/fields/new screen with an Inertia page (settings/fields/Edit) whose props are orchestrated by a FieldEditViewModel.

  • FieldsController::create() now returns an Inertia CpScreenResponse and honors a type query param so "Save and add another" preselects the last-saved type
  • Field type settings remain a server-rendered legacy HTML island, swapped via the existing fields/render-settings action and posted back to store() as a URL-encoded typeSettings string
  • store() accepts island settings via typeSettings alongside the legacy types array
  • Adds serializeFormInputs() for posting legacy HTML islands from Vue pages

The edit screen for existing fields still uses the Twig path.

Description

Related issues

Replaces the Twig-based settings/fields/new screen with an Inertia page
(settings/fields/Edit) whose props are orchestrated by a FieldEditViewModel.

- FieldsController::create() now returns an Inertia CpScreenResponse and
  honors a `type` query param so "Save and add another" preselects the
  last-saved type
- Field type settings remain a server-rendered legacy HTML island, swapped
  via the existing fields/render-settings action and posted back to store()
  as a URL-encoded `typeSettings` string
- store() accepts island settings via `typeSettings` alongside the legacy
  `types` array
- Adds serializeFormInputs() for posting legacy HTML islands from Vue pages

The edit screen for existing fields still uses the Twig path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@brianjhanson brianjhanson changed the title Port the new field page to Inertia + Vue [6.x] New field page to Inertia + Vue Jul 7, 2026
brianjhanson and others added 3 commits July 7, 2026 13:54
Extends the new-field Inertia port to existing fields. Full-page requests
to settings/fields/edit/{id} (and fields/edit-field) now render the
settings/fields/Edit page via FieldEditViewModel; slideout requests
(Craft.CpScreenSlideout('fields/edit-field'), with or without a field ID)
still get the legacy Twig screen as JSON — including the field layout
designer's create-field slideout, which the initial port had broken.

- FieldEditViewModel gains readOnly, metadataHtml, missingFieldPlaceholder,
  and missing-type handling (blank select option + placeholder, expected
  type used for options/settings/translation methods)
- The "Used by" metadata pane moves to a shared Cp\Html\FieldHtml so the
  Inertia page and the slideout sidebar render the same HTML
- The Vue page adopts the new default-layout convention (useAppLayout()
  instead of wrapping <AppLayout>, which double-rendered the CP shell after
  the app-layout-parity merge), adds read-only input states, the metadata
  sidebar column, and a server-defined Delete action with confirm

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant