Kirby 1.1.1

My todo list got longer and longer over the last weeks, so it's time for updates!

Today I'm happy to release a new version of Kirby as well as a new version of the
Kirby Panel. Both updates got a bunch of bug fixes together with a set of nice new features.

Kirby 1.1.1

Bug fixes

There are a lot of small little things, which should make Kirby more stable on various systems and with various configurations.

Some of you ran into problems when running Kirby in a subfolder.
That should finally be resolved now.

There have also been a few glitches when running Kirby on Windows, which is also fixed.

And finally a few bugs in the multi-language setup have been smashed.

To make sure that you get the best out of Kirby in combination with the panel, you should always make sure to run the latest version of both.

For a full list of changes and bug fixes, please check out the changelog.

New features and improvements

Let's move on to the cool stuff.

Smartypants

For all the typography enthusiasts out there I've included Smartypants. Smartypants is a nice little script, which improves common typography issues, such as quotes or dashes. To activate Smartypants, add the following line to your site/config/config.php:

c::set('smartypants', true);

$pages->nth($n)

It's easy to get the first or last element in a collection of pages with Kirby:

$first = $pages->visible()->first();

// or

$last = $pages->visible()->last();

But it's a bit of a hassle to get a specific page in a collection of pages by it's index. With the latest version of Kirby there's a new nth() method for all collections. Here are a few examples:

// get the first page in a set of pages with the new nth method
$first = $pages->visible()->nth(0);

// get the fourth project in a set of projects
$fourth = $pages->find('projects')->children()->nth(3);

// etc.

The coolest part about this? This also works for all kinds of files:

// get the third image for the current page
$image = $page->images()->nth(2);

// filter the documents for the current page first and then get the fifth document
$document = $pages->documents()->filterBy('extension', 'pdf')->nth(4);

// etc.

This can be very powerful in combination with chaining of multiple methods.

filterBy() revamped!

The filterBy() method has been quite cool already, but now it is on steroides!
See for yourself:

// get the main pages filtered by a specific template
$filtered = $pages->filterBy('template', 'default');

// get the main pages, but ignore those with a specific template
$filtered = $pages->filterBy('template', '!=', 'default');

// get a list of projects but ignore the project with the title "Project B"
$filtered = $pages->find('projects')
          ->children()
          ->filterBy('title', '!=', 'Project B');

// get a list of projects, with the title containing the string "Project"
$filtered = $pages->find('projects')
                  ->children()
                  ->filterBy('title', '*=', 'Project');

// get a list of images for the current page matching the string "thumb"
$filtered = $page->images()
                 ->filterBy('title', '*=', 'thumb-');

With the new ignore operator (!=) and the new match operator (*=) you get a whole new set of opportunities to work with sets of pages or files and to filter those.

How to update?

To update to the new version of Kirby, get the latest ZIP from Github. All you need to do is to replace your current kirby folder with the new kirby folder from the ZIP. If you got caching enabled in your config, you might need to remove all files from site/cache

Panel 0.9

The new panel version has multiple small improvements and bug fixes to run more smoothly with the latest version of Kirby. For a full list of updates, check out the changelog.

How to update?

To update to the latest version of the Panel, get the latest ZIP from Github and replace your current panel folder with the new files from the ZIP.

Feedback

I'm very excited to hear your thoughts about the latest updates!

Cheers, Bastian

Our partners

CDN by KeyCDN Search by Algolia

Top