Repository navigation
Releases
1.0.0
Kirby Global Blocks 1.0 is the first stable release and adds support for Kirby 6 and its Vue 3 Panel. For Kirby 5 (5.5 or newer), stay on 0.1.1.
composer require tobimori/kirby-global-blocks:^1.0🎉 Features
- Support for Kirby 6 and its Vue 3 Panel
- Built-in support for Kirby Agents: adds the
global_blocks_findMCP tool to search global blocks (including nested blocks and layouts) and list their usages, and extends theblocksandlayoutfield handlers so agents can read and place global blocks and update them on their_global/…page - Delete dialog lists every page, draft, or unsaved change that still uses a global block, with direct links to each placement
- Ships a fallback
global-block-previewtemplate out of the box that you can override atsite/templates/global-block-preview.php - Turning a block with page files into a global block now asks whether to copy those files to the global block instead of copying them unconditionally
✨ Enhancements
- Switched the license to MIT
- Inline block types defined in the
fieldsetsplugin option now work in the global block editor - Load the global block selector list on demand instead of sending it in every blocks field's props
- Cache the children of the
_globalcontainer page in memory to avoid repeated reads - Rewrote and expanded the documentation with a getting-started tutorial, guides, concepts, and reference
🐛 Bug fixes
- Fixed deleting a global block while any page has unsaved changes
- Fixed missing Add buttons and options in nested
blocksfields inside global blocks - Disabled merging multi-selected blocks when the selection includes a global block so merging cannot alter a global block across pages
- Kept the Panel usable for roles without the
tobimori.global-blocks.accesspermission, and respectedcreate,update, and corepagespermissions in the Panel - Found usages reliably on single-language sites and in site, user, file, structure, object, and nested block content
- Registered global blocks and their files in Kirby's
uuidcache sofile://references resolve across pages - Kept placement IDs stable, synced edits across repeated placements of the same global block, and saved inline edits in order (including global blocks edited inside another global block)
- Stored saved field values when turning a block into a global block, and deleted newly converted global blocks when host page changes are discarded
- Hid global blocks from public frontend URLs and required a Panel user with
accessor a preview token for preview requests
⚠️ Breaking changes
-
Requires Kirby 6 (6.0.0 or later, below 7). Sites running Kirby 5 (5.5 or newer) should stay on
0.x(composer require tobimori/kirby-global-blocks:^0.1). -
Global block references now resolve through the
GlobalBlockReferenceblock model instead of overridingtoBlocks()andtoLayouts()(theResolverclass and field method overrides were removed). Because a resolved placement is aGlobalBlockReferenceinstance that forwards method calls to the global block,instanceofchecks against custom block models fail for placements. Compare$block->type()instead:// Before if ($block instanceof CustomBlock) { // ... } // After if ($block->type() === 'custom') { // ... }
Full Changelog: 0.1.1...1.0.0
0.1.1
✨ Enhancements
- Declare supported Kirby versions (
^5.5) viaextra.kirby.compatibleandconflictinstead of requiringgetkirby/cms
🐛 Bug fixes
- Prevent missing Panel translations by building the global blocks container blueprint lazily instead of while plugins are loading (getkirby/kirby#8505)
Full Changelog: https://github.com/tobimori/kirby-global-blocks/commits/0.1.1