github getkirby/kirby 3.4.3

latest releases: 4.2.0, 4.2.0-rc.1, 4.1.2...
3 years ago

Features

New slugs.maxlength option

You can now restrict the length of slugs with the new slugs.maxlength option #1821

// site/config/config.php
return [
  'slugs' => [
    'maxlength' => 100
  ]
];

Required fields and when conditions

Required fields with when conditions now can be left empty, if the when condition does not apply.

fields: 
  category: 
    type: radio
    options: 
      - Photography
      - Editorial
  photographer: 
    when: 
      category: Photography  
    # the photographer field will now only be required when the category is "Photography" 
    required: true

Custom drag text for files and pages

You can now define custom text when files or pages get dragged into textareas. #2735

// site/config/config.php
return [
    'panel' => [
        'kirbytext' => [
            'fileDragText' => function ($file, $url) {
                return '(file: ' . $url . ' alt: ' . $page->alt() . ')';
            },
            'pageDragText' => function ($page) {
                return '(link: ' . $page->url() . ' text: ' . $page->title() . ')';
            }
        ]
    ]
];

Array support for Collection::not()

When filtering collections, you can now pass an array of IDs or objects to Collection::not()

$menu = $site->children()->not(['home', 'error'])

// or
$a = page('some-page-a');
$b = page('some-page-b');

$menu = $site->children()->not([$a, $b]);

More …

  • V::alpha($string, $unicode = false) and V::alphanum($string, $unicode = false) can now support unicode characters. This can be activated with the second argument.
    getkirby/ideas#234
  • You can now use Asset objects in panel previews #2746

Enhancements

  • Commas are now automatically removed from sortBy options in blueprints for enhanced usability. getkirby/ideas#195
# now both versions work
sortBy: date desc title desc
sortBy: date desc, title desc
  • We've increased test coverage for our PHP code from 84% to 90% 🎉
  • We've massively improved our doc block comments and type hints throughout our code base
  • The file dropdown is now better visually structured with horizontal lines – consistent with the look and feel of the page dropdown. #2787
  • $tableWhitelist in the Database class is now renamed to $tables and a validity check for correct table names is fixed. #2788
  • The beforeSend option for emails can now be predefined in the config #2769

Bug fixes

  • Fixed off-center emoji position in the panel
  • Fixed overflowing text in breadcrumb #2755
  • Fixed broken this.$api.users.list() method (this broke pagination and the role filter in the users view) #2801
  • Parsedown Extra no longer trims new line characters in some PHP environments
  • Fixed progress bar styling in Firefox #2784
  • You can now add pages in pages sections within user blueprints without errors #2771
  • Converting the $site object to string now returns the URL instead of throwing an error #2802

Stats

  • 101 commits
  • 32 closed issues and PRs

Don't miss a new kirby release

NewReleases is sending notifications on new releases.