Why use themes?
Why use a theme you might wonder? Kirby does not work like that, or does it?
I’m planning to use the same setup for a new site in the future. Design, layout and some functions should be the same, but the content, blueprints and controllers should be different.
To have the common parts of the project as a theme and the unique parts in the “normal” folders I get the best of both worlds. I can copy the theme easy and only lift over the common things.
I’m using my theme loader on a site and it works really well. Good job with the register set guys!
Kirby Theme loader
Load and switch themes from
Add the folder
- Add a folder called
- Add a folder with your theme name like
- Add a filename that matches the theme name like
- Add a
c::get('plugin.theme.loader.name', 'my-theme')to activate the theme.
To sum up, the theme filepath would be like
Making the theme
To make use of the theme loader you need to set stuff with the registry feature:
To activate a theme you need to add an option for it.
If you don’t want to load the theme from
site/themes you can change it.
c::get('plugin.theme.loader.root', kirby()->roots()->site() . DS . 'themes')
@Thiousi You make themes right? What do you think?