github getkirby/kirby 3.6.0-alpha.3

latest releases: 4.5.0-rc.1, 5.0.0-alpha.3, 4.4.1...
pre-release3 years ago

3.6 Alpha

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

Features

New Fiber Dropdowns

For context sensitive dropdown menus – such as the option dropdowns for pages, files or users – you need to collect a lot of information before the menu can be opened. Which options are available for the current model? Which permissions are to be considered, etc.? We solve this with asynchronous dropdowns, which load their options from the API.

With Fiber, we've managed to simplify those asynchronous dropdowns significantly. We can now create new complex dropdowns right in PHP in minutes. Dropdowns are part of the new Panel areas. Here's an example for a potential plugin.

Kirby::plugin('your-plugin/todos', [
    'areas' => [
        'todos' => [
            ...
            'dropdowns' => [
                'todos/(:any)' => function (string $id) {
                    // find the $todo here. (i.e. from a database)
                    return [
                        [
                            'text'   => 'Edit',
                            'dialog' => 'todos/' . $id . '/edit',
                            'icon'   => 'edit'
                        ],
                        [
                            'text'   => 'Duplicate',
                            'dialog' => 'todos/' . $id . '/duplicate',
                            'icon'   => 'copy'
                        ],
                        [
                            'text'   => 'Delete',
                            'dialog' => 'todos/' . $id . '/delete',
                            'icon'   => 'trash'
                        ]                        
                    ];  
                }
            ]
        ]    
    ]
]);

Your dropdown options can then be loaded in your Vue code like this:

<k-dropdown>
    <k-button icon="cog" @click="$refs.options.toggle()">Options</k-button>
    <k-dropdown-content ref="options" :options="$dropdown('todos/the-todo-id')" />
</k-dropdown>

The most exciting part: it will soon be possible to overwrite and extend our default dropdowns for pages, files and users 🎉

Just think about it. You can create simple plugins to add additional options to cross-post page content on social media, start generating static versions, edit files, and so much more. It's all up to you.

New Fiber Search

Very much like the new Fiber views, dialogs and dropdowns, Panel search is now also massively simplified. Our default searches for pages, files and users already run on Fiber in this new release and your plugins can now create their own new search types, which will automatically be available in our search dialog.

Kirby::plugin('your-plugin/todos', [
    'areas' => [
        'todos' => [
            ...
            'searches' => [
                'todos' => [
                    'label' => 'Todos',
                    'icon' => 'check',
                    'query' => function () {
                        // search for $todos here. 
                        $results = [];
                        
                        foreach ($todos as $todo) {
                            $results[] = [
                                'image' => [ // optional image settings ],
                                'text'  => $todo->text(),
                                'link'  => '/todos/' . $todo->id(),
                                'info'  => 'Get it done!'
                            ];
                        }

                        return $results;
                    }                    
                ]
            ]
        ]    
    ]
]);

That's all it takes to create your own search index for your own plugins.

The search will automatically appear in the search dialog, but can also be run manually from your Vue components with …

const query = 'Searchy search';
const todos = await this.$search('todos', query);

Like all other Fiber features, it will soon be possible to overwrite and extend our default searches for pages, files and users 🎉

New core methods

  • New $blocks->hasType() method
  • New $layouts->toBlocks() method
  • New $layouts->hasBlockType() method

Enhancements

  • Enhanced CSS support for RTL Panel interface #3556
  • New v-direction directive to set the dir attribute based on the current content translation #3568
  • File view uses stable preview link for files (instead of media folder URL) #3575
  • The Data\Json::decode() and Data\Xml::decode() methods now accept empty strings and treat them as an empty data set (empty array) for consistency with Data\Txt::decode() and Data\Yaml::decode() #3565

Fixed

  • Fixes blocks field sort handle on hover #3538
  • Fixes writer field RTL support https://kirby.nolt.io/322
  • Fixed version number in settings view in RTL interface #3581
  • Fixed manual files sorting via changePosition dialog #3589

Fixed regressions from 3.6.0-alpha.2

  • Fixes drag handle for picker fields #3553
  • Fixes blocks field options bar #3552
  • Fixes correct dir attribute for fields #3568
  • Styling for tabbed link highlighting works again #3576
  • Topbar is fully responsive again #3574
  • Languages get deleted without error again #3588
  • Dropdowns and dropdown buttons no longer appear above the save bar. #3554

Breaking Changes

  • CSS class .k-block-handle has been replaced with .k-sort-handle

Don't miss a new kirby release

NewReleases is sending notifications on new releases.