Skip Navigation
Docs

Spielzeug

Spielzeug is a encapsulated set of helpers & tools we use for our projects and that serves as the independent foundation for Baukasten. Whenever we need a new general purpose function, method or any addition that can be encapsulated in a plugin, they'll be added in here.

In comparison to Baukasten, Spielzeug uses semantic versioning.

Installation

composer require tobimori/kirby-spielzeug

Block system & the $block->attr() helper

Most of our pages are build in a page-builder-like fashion utilizing the Kirby Blocks field. To make it easier to work with, I've implemented a helper that allows you to deploy a block with a set of base attributes.

<section <?= $block->attr(['class' => 'container']) ?>>
// <section
//    class="container"
//    id="id-from-fields"
//    data-next-block="footer"
//    data-prev-block="navigation"
// >