Trying to make use of GitHub - getkirby/layouts: Extend Kirby’s templates with a powerful layout system (version 1.0.1) in my sites. I define all of my templates in a plugin for easy reuse.
Changes:
- Added
/layouts/default.php - Updated index.php of plugin to reference the layout.
- Changed my
/templates/default.phpto use layout.
layouts/default.php
<?php snippet('start'); ?>
<div id="page" class="flex flex-col min-h-screen">
<?php snippet('header') ?>
<div class="flex-grow">
<main>
<?php slot() ?>
<?php endslot() ?>
</main>
</div>
<?php snippet('footer') ?>
</div>
<?php snippet('end') ?>
Plugin index.php
'layouts' => [
'default' => __DIR__ . '/layouts/default.php',
],
templates/default.php
<?php layout() ?>
<?php snippet('page-builder') ?>
Seems to only work when layouts/default.php lives in the /site folder. I need it to work when it lives in my plugin. Any way to make this work?