And so much more
Content negotiation
Content representations like site/templates/article.md.php could so far only be requested with the file extension in the URL, e.g. /blog/my-article.md. In Kirby 6, the Accept header of a request works as well. https://feedback.getkirby.com/741
# <?= $page->title() ?>
<?= $page->text() ?>
curl -H "Accept: text/markdown" https://example.com/blog/my-article
This request gets the Markdown representation of the page from its regular URL. Handy for tools and AI agents that ask for Markdown, and it works for any representation that Kirby knows a MIME type for, e.g. application/json for article.json.php.
Objects as field values
$model->update() accepts Kirby objects and collections as values for the fields of the blueprint. Each field converts them into the format that it stores:
$page->update([
'cover' => $file,
'related' => $page->siblings()->listed(),
'authors' => $kirby->users()->role('editor'),
'text' => $page->text()->toBlocks(),
'gallery' => $other->gallery(),
'date' => new DateTime(),
]);
Smarter queries
Kirby queries support the logical not operator and negative values:
fields:
visibility:
type: info
text: "{{ !page.isListed ? 'Not visible on your site yet' : 'Live on your site' }}"
More examples: !user.isAdmin ? "guest" : "admin", -page.price or -(1 + 2).
Date formats with text
The display format of date and time fields supports text in square brackets, which is printed as it is:
fields:
meeting:
type: date
display: D. MMMM [in the year] YYYY
time:
display: HH[h]mm
Empty date and time fields also show an example of their display format as placeholder, so editors know the expected notation before they start typing.
Easier date input
Date and time fields parse what you type in the field's own display format instead of blind guessing. Month names and their abbreviations are recognized in English and in the current Panel language. If your input can't be read, the field keeps it and marks it as invalid instead of silently clearing it.
Upload in the file picker
The file picker dialog is a drop zone now. Drag files from your computer onto the open dialog to upload them, and they are selected right away. This works whenever the field allows uploads.
Unsaved changes at a glance
Field labels are highlighted as long as a field has unsaved changes. In long forms, you can see at a glance what you've changed before you save.
Copy from disabled fields
Disabled fields still can't be edited, but you can select and copy their values now.
Sharper image block previews
The previews of image and gallery blocks load properly sized thumbnails that respect the ratio and crop settings of the block.
Required PHP extensions
During installation, Kirby checks all required PHP extensions and blocks the installation if one is missing: ctype, curl, dom, filter, hash, iconv, json, libxml, mbstring, openssl and SimpleXML. The system view in the Panel shows an alert if one of them is missing on an existing installation.
More MIME types
Kirby knows the MIME types of more file extensions: 7z, aac, apng, atom, epub, ods, oga, rar, svgz, vtt, wasm, weba and webmanifest. ico and psd also map to their registered types now.
Disable core Panel features
Plugins can remove any core definition from a Panel area by setting it to false. This already worked for menu items and view buttons and now covers dialogs, drawers, dropdowns, requests, searches and views as well. For example, to remove the file search:
<?php
use Kirby\Cms\App as Kirby;
Kirby::plugin('acme/no-file-search', [
'areas' => [
'site' => [
'searches' => [
'files' => false
]
]
]
]);