https://github.com/presprog/kirby-php-blueprint-loader
Dynamically loads PHP-based blueprints from your Kirby CMS site folder
https://github.com/presprog/kirby-php-blueprint-loader
developer-experience kirby-cms kirby-plugin kirby4
Last synced: 7 months ago
JSON representation
Dynamically loads PHP-based blueprints from your Kirby CMS site folder
- Host: GitHub
- URL: https://github.com/presprog/kirby-php-blueprint-loader
- Owner: presprog
- License: mit
- Created: 2025-04-01T14:19:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-02T14:02:50.000Z (over 1 year ago)
- Last Synced: 2025-12-18T16:48:24.893Z (7 months ago)
- Topics: developer-experience, kirby-cms, kirby-plugin, kirby4
- Language: PHP
- Homepage:
- Size: 118 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README

# Kirby PHP Blueprint Loader Plugin
Start using PHP blueprints in your `site` folder today!
> ⚡ Ready for Kirby 4!
----
## 🚀 How to use
Kirby lets you use PHP-based blueprints in plugins, e.g. to use different blueprints for different user roles. This is thoroughly described [in Sonja's fantastic cook book article](https://getkirby.com/docs/cookbook/development-deployment/programmable-blueprints). Unfortunately, this does not work with the native `blueprints` folder, usually residing in `site/blueprints`.
After installing this plugin, you can start using PHP-based blueprints in `site/blueprints` folder, just like you would in plugins!
```php
// site/blueprints/pages/blueprint.php
$user = kirby()->user();
$fields = [
// Field config for all users
];
if ($user->isAdmin()) {
$fields = [
// Admins should have a separate set of fields
];
}
return [
'title' => 'PHP-based blueprint',
'fields' => $fields,
]
```
> ⚠️ Any existing YAML blueprint under the same name will be overwritten.
[//]: # (## ⚙️ Config)
## 💻 How to install
Install this plugin via **Composer**:
```bash
composer require presprog/kirby-php-blueprint-loader
```
Or **download the ZIP file** from GitHub and unpack it to `site/plugins/php-blueprint-loader`
## 📄 License
MIT License Copyright © 2025 Present Progressive
----

Made by [Present Progressive](https://www.presentprogressive.de) for the Kirby community.