Skip to content

presprog/kirby-php-blueprint-loader

Repository files navigation

Kirby PHP Blueprint Loader Plugin

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. 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!

// 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.

💻 How to install

Install this plugin via Composer:

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 for the Kirby community.

About

Dynamically loads PHP-based blueprints from your Kirby CMS site folder

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages