You can create full HTML layouts in a new /site/layouts
folder. Layouts can define slots, which will then be filled with content by templates. Layouts are based on our new snippets with slots and work exactly the same way. The only difference is the folder location. You can learn more about our snippets with slots in our docs: http://getkirby.com/docs/guide/templates/snippets#passing-slots-to-snippets
<html>
<head>
<title><?= $page->title() ?></title>
</head>
<body>
<?= $slot ?>
</body>
</html>
<?php layout() ?>
<h1>Hello world</h1>
<p>This will end up in the default slot</p>
To use a specific layout, you can pass its name to the layout()
method.
<html>
<head>
<title>Blog</title>
</head>
<body>
<h1>Blog</h1>
<?= $slot ?>
</body>
</html>
<?php layout('blog') ?>
<!-- some articles -->