Kirby v3.3.0 Release Notes
Release Date: 2019-11-05 // over 4 years ago-
π New features
π See all unsaved changes
π When you edit pages, files or user accounts, you will see a new "unsaved changes" icon in the topbar. The overview of unsaved changes makes it a lot easier to keep track of content that is still work-in-progress. #1979
π New icons
We added a set of new icons that have been requested by our users and that we consider "essential". #2209
The following new icons are now available:
- bell - book - bookmark - box - bug - car - cart - chart - chat - credit-card - folder - heart - home - layers - linkedin - map - question - star - strikethrough - underline - vimeo - whatsapp - wheelchair - youtube
π New toggle field preview
Toggle fields in structures come with a great new preview and are even usable right from the structure overview #2126
You can also switch off the toggle text in structure columns entirely with the text option #2244:
fields: links: type: structurecolumns: url: truefeatured: text: falsefields: url: type: url featured: type: toggle
π§ Language-specific Smartypants configuration
π§ You can change the Smartypants configuration for quotes and other typographical details, based on the current language. #2037
\<?php// /site/languages/de.phpreturn ['code' =\> 'de','direction' =\> 'ltr','locale' =\> 'de\_DE''name' =\> 'Deutsch','smartypants' =\> ['doublequote.open' =\> 'β','doublequote.close' =\> 'β',]];
π New ErrorPageException
π With the new ErrorPageException you can stop your code in your controllers, templates or plugins immediately and render the error page instead of the current page. This makes reacting to fatal errors a lot easier. #1887
Here's a controller example:
return function ($page) {$filters = ['latest', 'featured', 'deprecated'];if (in\_array(param('filter'), $filters)) {throw new ErrorPageException('The filter is not accepted'); }return ['filter' =\> $filter];};
Search and pagination in files, users, and pages fields
π You can search and paginate pages, files and users in the dialogs of the users, files and pages fields. #2208
π New subpages option for the pages field
Enable or disable subpage navigation in the pages field with the new
subpages
option
getkirby/ideas#217fields: related: type: pagesquery: site.find("blog").childrensubpages: false
π CSS variables for plugin developers
π We are introducing the first set of css variables for plugin developers. This will make it a lot easier to follow Kirby's panel design by using the right colors, font sizes, etc. The following variables are available.
/ **Colors** / --color-backdrop --color-background --color-border --color-focus --color-focus-light --color-focus-outline --color-negative --color-negative-light --color-negative-outline --color-notice --color-notice-light --color-positive --color-positive-light --color-positive-outline --color-text --color-text-light / **Font families** / --font-family-mono --font-family-sans / **Font sizes** / --font-size-tiny --font-size-small --font-size-medium --font-size-large --font-size-huge --font-size-monster / **Shadows** / --box-shadow-dropdown --box-shadow-item --box-shadow-focus
π New ready callback
Register last-minute options with the new ready callback. This callback is executed when Kirby's instance is ready to be fully used and you can use all roots, urls and other stuff from Kirby to set additional options accordingly. #1724
\<?php // site/config/config.phpreturn ['ready' =\> function ($kirby) {return ['db' =\> ['database' =\> $kirby-\>root('site') . '/db/database.sqlite','type' =\> 'sqlite'] ]; }];
Extendable dump() helper
Overwrite our dumper with your own implementation or an implementation from a framework
getkirby/ideas#339Kirby::plugin('my/dumper', ['components' =\> ['dump' =\> function ($kirby, $variable, bool $echo = true) {// dump that var }]]);
Collection::when()
π Use the new
when()
method for any collection to simplify your code when filtering or sorting items getkirby/ideas#349$size= get('size');$color = get('color');$price = get('price')$products = $page-\>children()-\>when($size, function ($size) {return $this-\>filterBy('size', $size); })-\>when($color, function ($color) {return $this-\>filterBy('color', $color); })-\>when($price, function ($price) {return $this-\>filter(function ($child) use ($price) {return $child-\>price()-\>toFloat() \<= $price; }); });
$library and $helper
π All plugin developers have full access to the helpers and libraries that we use in the panel with the new
$library
and$helper
objects in Vue.js. #1846Here's an example of how to use our slug helper inside a Vue component:
const slug = this.$helper.slug("MΓΆtorhead rulez!!");
The following helpers and libraries are available:
// helpersthis.$helper.clonethis.$helper.isUploadEventthis.$helper.debouncethis.$helper.padthis.$helper.ratiothis.$helper.slugthis.$helper.sortthis.$helper.string.ucfirstthis.$helper.string.lcfirstthis.$helper.upload// librariesthis.$library.autosizethis.$library.dayjs
π New hooks
π The following new hooks are available for your plugins getkirby/ideas#350, getkirby/ideas#23
- system.loadPlugins:after - user.login:before - user.login:after - user.logout:before - user.logout:after
β Additional new features
- You can search by username in the global search
Collection::intersection()
andCollection::intersects()
getkirby/ideas#214- π New
$pages->notTemplate()
method - π New
Visitor::preferredMimeType()
method - π New
Visitor::prefersJson()
method - π New
Mime::matches()
method - π New
::panelOptions
method for all models (Page, User, File) #1951 - π New
flip
option for pages and files sections getkirby/ideas#97 - π New
$field->inline()
method - π New
$field->nl2br()
method - π New
$kirby->nonce()
which can be used in custom CSP settings - The
svg
helper now accepts Kirbyβs File objects
π₯ Breaking changes
- 0οΈβ£ The pagination object is now immutable and all setters are disabled by default #1887
- π¨ The Vuex
form
store module in the panel has been refactored and is now calledcontent
. If your panel plugin works with the form store module, please check out the refactored module. Conversion won't be difficult. We made lots of thinks a lot cleaner. But you need to rename the actions or getters that you use from the old module. - The
v-tab
directive is no longer available. Tabbable elements should use thetab
mixin
π Deprecated methods
- π The deprecated
$kirby->root('translations')
root is no longer available. Use$kirby->root('i18n:translations')
instead
π We've also added deprecation warnings to additional core methods. You will run into an exception if the debug mode is active. You can keep those methods for now in production (with disabled debug mode), but we recommend to convert them as soon as possible. Here are the deprecated methods and how to replace them:
File::meta
(useFile::content
instead)File::rename
(useFile::changeName
instead)- 0οΈβ£
Languages::findDefault
(useLanguages::default()
instead) Page::hasInvisibleChildren
(usePage::hasUnlistedChildren
instead)Page::hasNextInvisible
(usePage::hasNextUnlisted
instead)Page::hasNextVisible
(usePage::hasNextListed
instead)Page::hasPrevInvisible
(usePage::hasPrevUnlisted
instead)Page::hasPrevVisible
(usePage::hasPrevListed
instead)Page::hasVisibleChildren
(usePage::hasListedChildren
instead)Page::nextInvisible
(usePage::nextUnlisted
instead)Page::nextVisible
(usePage::nextListed
instead)Page::prevInvisible
(usePage::prevUnlisted
instead)Page::prevVisible
(usePage::prevListed
instead)Page::isInvisible
(usePage::isUnlisted
instead)Page::isVisible
(usePage::isListed
instead)Site::hasInvisibleChildren
(useSite::hasUnlistedChildren
instead)Site::hasVisibleChildren
(useSite::hasListedChildren
instead)
β¨ Enhancements
A11y and keyboard navigation
- β¬οΈ Dropdowns automatically close when you navigate outside with the tab key
- The multiselect field can be focused correctly with the tab key
- The dropdown in the multiselect field no longer jumps to the top when you select an item
- The multiselect field can be correctly opened via space or enter keys #2187
- Tab navigation in fields is prevented when the form is locked #2204
- The Ctrl key can be used as meta key for textarea shortcuts #2113
- We've improved the accessibility of the page status title in list items and cards #566
- π Better link highlighting on tab
- π Better keyboard navigation in pagination dropdown
- π¨ Refactored button component to use button, link or span (disabled buttons) when appropriate #566
π User experience
- The global search automatically searches for users, when you are in the user area of the panel
- π We removed the name field from the installer to set the focus on the importance of the email address #1802
- π Links in field help text can now be clicked, even if the field is disabled #2170
- We've added a bigger margin to all dropdowns to avoid annoying overlaps with the bottom bar and other elements at the bottom #1563
- Decimals are always correctly displayed when leaving the number field #1748
- π¨ The dialog to create new pages shows the order of templates in the way specified in the blueprint #2161
- The login no longer shakes on errors, but displays a more traditional alert with a error message #2161
- Sections, structure and picker fields show the same red border when they are invalid #1581
- When a page, file or user is locked, the bottom bar features a new activity indicator when the changes cannot be unlocked yet #2195
Developer experience
- π¨ We've refactored the entire content store module for Vuex to provide easier access to all content changes #1866
- π Doc block enhancements for better IDE support
- 0οΈβ£ We've added the idea folder to the default
.gitignore
for users who use JetBrains editors - π¨ Infer section type from name in blueprints getkirby/ideas#120
- When the collection pagination is used in the frontend with a page number that exceeds the number of pages, the error page is now rendered automatically. #1887
- The users field no longer stores email addresses, but the user id. This change is fully backwards compatible. The user field will work with old email entries and overwrite them once you save again. #1885
- We've added localhost support and removed 127...* ip restrictions in the
V::url()
validator #2130 - π»
$pages->add()
throws an exception when you try to add invalid objects #1890 - The max length of
Str::slug()
is restricted to 128 characters and added a new$maxlength
argument - π¨ Structure fields throw an exception when no fields are defined in the blueprint #2236
API enhancements
- The API now respects locale settings on single-lang site
- π The options Api requests for pages, users and files respect the lock state of the model and skip the right options that should not be usable.
π Translations
- The pagination page label in the panel is translatable #2194
- The title attribute for required fields and sections is translatable #2227
π Performance
- π The status dialog for pages only loads siblings if necessary to increase the performance #2052
π Fixes
- Languages can use their own domains again. This has been a big annoying regression from v2 #1382
- π Fixed bugs in slug generation with custom rules #2138
- π Fixed reactivity for all k-input $props and $attrs #2181
- Youtube and Vimeo options are passed correctly to the iframe when using the
vimeo()
andyoutube()
helpers #2118 - β Removed unused text attribute from image kirbytag #2136
- The correct error messages are shown when exceptions are thrown in hooks #2155
- 0οΈβ£ The default order for files is fixed and respects the sorting number and filename #1675
- π The email placeholder in lock notification is correctly replaced with the actual email address #2134
- The same characters are allowed when renaming or uploading files #2164
- π File sorting is now fixed in MS Edge #1973
- π Fixed "Replace" and "Open" menu items for files and pages in Safari #1951
- β‘οΈ The internal cache for translations is correctly flushed in Site and Page classes after updates #2189
- Form errors show details #2202
- π Improved
Collection::_unset()
which solves a lot of problems of deleting collection items in a loop #1232 - The "Add" button in pages section is no longer displayed when the
create
option is set to false - π» HTML in field and section exception messages can no longer propagate through the API to the panel
- π Fixed save button display glitch when saving #2246
- π Fixed undefined password error in the "Change password" dialog #2239
- The slug is validated before a page gets created #2243
- π Content locking fails silently in the panel when it is no longer supported by the model #2245
- Content locking no longer throws an error when a page gets deleted #2251
- π The
$page->isChildOf()
method is fixed and behaves as expected #2255 - The site title is validated before it can be saved #2261
Code/Project Quality
- π We now use PHPStan to check for typical code issues. The first fixes have already been made
- β‘οΈ We've optimized our Travis setup, which now runs in under 2 minutes.
- β We've added the first set of unit tests for our Vuex store modules
- β We now test PHP 7.4 on Travis