With Kirby Component Kit you can build your site with components. Itโs partly inspired by Patterns, but has some major differences.
I hope the teaser video will give you a good idea of how it works. In the video you can see components of a modified version of the starterkit, which I got permission to use.
Youtube teaser video
Screenshot
Any feedback is greatly appreciated.
6 Likes
Version 0.1 is out!
Now it has been released, free for everyone to try out as long as you need:
Github: https://github.com/jenstornell/kirby-component-kit
How well does the first version work?
Iโve made the whole starterkit โthemeโ as components. So this plugin is well tested. The last week Iโve been building my new site http://nallepresent.se, which is 100% components as well. Now, I donโt want to build a site without it.
Kirby 3 support
It should not be that much work to port this plugin to Kirby 3. In fact, with the new features that Kirby 3 has, it could be even better. For now it only works with Kirby 2, because Kirby 3 is not yet released.
The screenshot and the video preview in the previous post is still accurate.
Enjoy!
I need your help to answer a poll
Iโm doing big changes so there will be some kind of update and I even have plans to move to a MIT license.
A common component may look like this:
my-component/
โโ blueprint.yml
โโ controller.php
โโ component.php
โโ image.jpg
โโ script.js
โโ style.scss
Autoloading file
It will soon support a file that will autoload before template, snippets and controllers run.
The reason for it is that maybe we have methods that would be better off in a separate file, but still part of the component. Else there would be jump back and forth between the plugins and the components.
What should the name of that file be?
If you have a better idea than these, please add a comment.
- autoloader.php
- autoload.php
- load.php
- init.php
- methods.php
- functions.php
I voted for one of your options but maybe helper.php is a good name too.
1 Like
Thanks for your votes! I will use autoload.php
.
Because of performance and other things Iโve changed syntax of the options from yaml to php. It also looks more like the Patterns plugin. Now it looks kind of like this:
return [
'page' => page('categories')
];
What is a good filename for options?
- options.php
- settings.php
- config.php
Both options and settings tells what itโs all about. On the other hand, config is used by both the core and the patterns plugin.