Block Access

Blocks can be gated just like pages and files. Use this page when you want mixed free and paid content on the same page.

Block blueprint

site/blueprints/blocks/example.yml
name: Example Block
preview: fields
wysiwyg: true
fields:
  gates:
    extends: fields/klub/gates/plans
  text:
    label: Text
    type: textarea

Filtering blocks in templates

<?php foreach ($page->blocks()->toBlocks()->removeNotAllowed() as $block): ?>
  <?= $block ?>
<?php endforeach ?>

Each block also supports $block->allows() if you need custom logic.

Kirby Klub is not affiliated with the developers of Kirby CMS. We are merely standing on the shoulder of giants.
© 2026 Bruno Meilick All rights reserved.