Skip to content

3.6.0-beta.3

Pre-release
Pre-release
Compare
Choose a tag to compare
@afbora afbora released this 08 Oct 08:30
c33cf1c

3.6 Beta

To learn more about Kirby 3.6 and the beta phase, check out our dedicated preview site: https://getkirby.com/releases/3.6

🎉 Features

Core component: email #3766

Developers can now easily integrate their own email providers (sendgrid, mailgun, mailchimp, sparkpost, etc), instead of using Kirby's default PHPMailer library.

class CustomEmailProvider extends Kirby\Email\Email
{
    public function send(bool $debug = false): bool
    {
        // sending stuff
        return true;
    }
}

Kirby::plugin('my/email', [
    'components' => [
        'email' => function ($kirby, $props, $debug) {
            return new CustomEmailProvider($props, $debug);
        }
    ]
]);

Extends blocks and layout methods #3739

Using the new 5 extensions below, you can write your own custom methods for the blocks and layout fields.

  • layoutsMethods (layouts collection)
  • layoutMethods (each layout)
  • layoutColumnMethods (each layout column)
  • blocksMethods (blocks collection)
  • blockMethods (each block)
<?php

Kirby::plugin('my/blocksLayoutMethods', [
    'blockMethods' => [
        'test' => function () {
            return 'block method';
        }
    ],
    'blocksMethods' => [
        'test' => function () {
            return 'blocks method';
        }
    ],
    'layoutMethods' => [
        'test' => function () {
            return 'layout method';
        }
    ],
    'layoutColumnMethods' => [
        'test' => function () {
            return 'layout column method';
        }
    ],
    'layoutsMethods' => [
        'test' => function () {
            return 'layouts method';
        }
    ]
]);

Extendable block models #3740

Now each block type can have its own custom model. Like models for page templates or user roles.

<?php

use Kirby\Cms\Block;

class HeadingBlock extends Block
{
    public function id(): string
    {
        return 'custom id';
    }
}

Kirby::plugin('my/blockModels', [
    'blockModels' => [
        'heading' => HeadingBlock::class
    ]
]);

Default model for blocks #3747

When defining a custom model, the Kirby\Cms\Block class represents the default model for all blocks.

<?php

use Kirby\Cms\Block;

class DefaultBlock extends Block
{
    public function id(): string
    {
        return 'custom id';
    }
}

class HeadingBlock extends DefaultBlock
{
    public function test(): string
    {
        return 'Hello World!';
    }
}

Kirby::plugin('my/blockModels', [
    'blockModels' => [
        'Kirby\\Cms\\Block' => DefaultBlock::class
        'heading' => HeadingBlock::class
    ]
]);

✨ Enhancements

  • Multiselect with CMD/CTRL keys for blocks field #3748
  • Updated npm dependencies #3744
  • Blocks are now always selected in the original order, no matter in which order they have been selected in.
  • Parsing blocks from Word documents is now a lot more reliable and the results will be better.
  • Canonical language URLs in the Panel #3759

🐛 Fixes

  • Fixed parsing logic for entire documents and breaks when pasting blocks #3735
  • The expired DST Root CA X3 CA certificate (previously used for Let's Encrypt certificates) has been removed from the CA bundle to prevent "expired certificate" warnings when requesting remote resources (like in options API fields) on some server systems #3765
  • Fixed unstable links / hashes for media files #3646

🐛 Fixed regressions from 3.6.0-beta.2

  • k-item now features former k-list-item slots again
  • Fixed border-radius and box-shadow on image in lists #3733
  • Backward and forward buttons work properly in the Panel again
  • Fixed unwanted hover effect on disabled buttons #3742
  • Fixed translation bug after login and installation #3725
  • Fixed empty box layout for cardlets
  • Fixed block selector collapsing when there are no groups
  • Fixed low quality thumbnail in the pages field #3756
  • Fixed unsaved changes loop caused by the blocks field #3736
  • Fixed odd revert behaviour caused by the blocks field #3008
  • Fixed escaped HTML in blueprint info box #3763
  • Fixed files field option dropdown when upload disabled #3768
  • Fixed node issues in the writer field #3749
  • Fixed missing href attribute for email addresses in the writer #3754

⚠️ Breaking Changes

  • F::modified() does no longer calculate a maximum between mtime and ctime for file changes. This could in theory lead to different timestamps in some scenarios. Very unlikely though.