akqa-nz / silverstripe-elemental-nested
Ordered nested items within Elemental blocks, with a dedicated CMS editor UI.
Package info
github.com/WPP-Public/silverstripe-elemental-nested
Type:silverstripe-vendormodule
pkg:composer/akqa-nz/silverstripe-elemental-nested
Requires
- php: ^8.3
- dnadesign/silverstripe-elemental: ^6
- silverstripe/cms: ^6
- silverstripe/versioned: ^3
Requires (Dev)
- phpunit/phpunit: ^11.5
- silverstripe/recipe-testing: ^4
- squizlabs/php_codesniffer: ^3.7.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-10-27 01:57:05 UTC
README
Ordered nested items inside Elemental blocks for Silverstripe CMS 6.
Overview
Apply HasNestedItems to any BaseElement subclass to manage a sorted list of NestedItem records. Nested items are lightweight DataObject records (not full blocks): they inherit publish state from the parent, support inline editing in the Elemental editor, and can be reordered, hidden, duplicated, or moved to another compatible parent on the same page.
Requirements
- PHP 8.3+
- Silverstripe CMS 6
dnadesign/silverstripe-elemental6
Installation
composer require akqa-nz/silverstripe-elemental-nested
Build CMS assets (from this module directory, with Node 18+):
yarn install yarn build
Usage
Define nested item classes:
use AKQA\ElementalNested\Models\NestedItem; class LinkItem extends NestedItem { private static array $db = ['URL' => 'Varchar(2048)']; }
Enable nested items on a block:
use AKQA\ElementalNested\Extensions\HasNestedItems; class LinkListBlock extends BaseElement { private static array $extensions = [HasNestedItems::class]; private static array $allowed_nested_items = [LinkItem::class]; }
In templates:
<% loop $Element.getVisibleNestedItems %>
<% include $ClassName.ShortName %>
<% end_loop %>
Licence
BSD-3-Clause