🌱 The next big step: Kirby 4 Beta Learn more
Skip to content

Panel improvements

Dialogs for fields

Fields can now define their own dialogs on the backend.

  • Fields with array definition:

    return [
    'props' => [
      // ...
    ],
    'dialogs' => function () {
      return [
        [
          'pattern' => 'delete',
          'load' => function () {},
          'submit' => function () {},
        ]
      ];
    }
    ];


  • Field classes:

    class MyField extends FieldClass
    {
    public function dialogs(): array
    {
      return [
        [
          'pattern' => 'delete',
          'load' => function () {},
          'submit' => function () {},
        ]
      ];
    }
    }

The route patterns for field dialogs are automatically prefixed with the following scheme:

dialogs/$modelPath/fields/$fieldName/$pattern

Here's an example:

dialogs/pages/blog/fields/blocks/delete

In a field component, the dialog can be opened by using the field endpoint:

this.$dialog(this.endpoints.field + "/delete")

More improvements

  • Pages section: new templatesIgnore option #5322
  • Users field: set default: true to always use the currently logged in user as default

New Icons

We've added new icons to our Panel iconset:

  • anchor
  • clear
  • split
  • merge

New Components

  • <k-code>
  • <k-dialog-body>
  • <k-dialog-box>
  • <k-dialog-buttons>
  • <k-dialog-fields>
  • <k-dialog-footer>
  • <k-dialog-form>
  • <k-dialog-notification>
  • <k-dialog-search>
  • <k-dialog-text>
  • <k-notification>
  • <k-drawer-body>
  • <k-drawer-fields>
  • <k-drawer-header>
  • <k-drawer-notification>
  • <k-drawer-tabs>
  • <k-tree>
  • <k-page-tree>
  • <k-browser>
  • <k-file-browser>

New helpers

  • $helper.focus(element)
  • $helper.object.length(object)
  • $helper.string.isEmpty(string)
  • $helper.url.base
  • $helper.url.buildQuery
  • $helper.url.buildUrl
  • $helper.url.isAbsolute
  • $helper.url.isSameOrigin
  • $helper.url.isUrl
  • $helper.url.makeAbsolute
  • $helper.url.toObject

New JS error classes

  • RequestError
  • JsonRequestError

More to come …

We are not done here …