Sorry, we don't support your browser.  Install a modern browser

Page create dialog: keep a templated slug visible & editable

When a page blueprint defines a templated create.slug, the page-create dialog shows no slug field at all. Instead, the slug is computed silently on submit, so the editor can neither see nor adjust the resulting slug while creating the page.

Example blueprint:

create:
  title:
    label: Project title
  slug: "{​{​ page.title.slug }}-{​{​ page.title_sub.slug }}"
  fields:
    - title_sub

Here the slug is nicely derived from two fields (title + title_sub), but it’s invisible at creation time.

Why the two goals are currently mutually exclusive: In Kirby\Panel\PageCreateDialog::coreFields(), the slug field is added only when create.slug is unset, and its sync source is hardcoded to title:

// slug field
if ($slug === null) {
    $fields['slug'] = Field::slug([
        'required' => true,
        'sync'     => 'title',
        'path'     => ...
    ]);
}

So today it’s an either/or:

create.slug unset => visible, editable slug field, but it can only sync from title (can’t reflect a multi-field template).
create.slug templated => correct multi-field slug, but no field is rendered (silently resolved on submit).

Proposal

Allow a templated create.slug to still render a visible, editable slug field in the dialog, pre-filled from the resolved template (and re-resolving as the driving fields change, like the current sync). That would give both: automatic derivation and visibility/adjustability at creation.

A lighter-weight variant: expose the slug field’s sync source in the blueprint (e.g. create.slug.sync: [title, title_sub]) so the visible field can be driven by more than just title.

Impact

Small, well-scoped change to PageCreateDialog; today the behavior is a hard either/or that forces editors to open the slug editor after creation to verify it.

9 hours ago