This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Adds a level of nesting to a CheckboxSetField using a has_many/has_one relationship

dev-master 2013-07-18 05:16 UTC

This package is auto-updated.

Last update: 2021-09-15 03:08:19 UTC


This adds an extra level to a CheckboxSetField, which provides some structure to a large dataset.

Example Usage

The below will produce a set of nested fields where each Tag (which is selectable) sits under a Tag Category (just a heading, not selectable).

class Page extends SiteTree { static $many_many = array( 'PageTags' => 'Tag' );

public function getCMSFields() {
    $fields = parent::getCMSFields();

        NestedCheckboxSetField::create('PageTags', 'Page Tags')


class Tag extends DataObject { static $db = array( 'Title' => 'Varchar(100)' );

static $has_one = array(
    'Category' => 'TagCategory'


class TagCategory extends DataObject { static $db = array( 'Title' => 'Varchar(100)' );

static $has_many = array(
    'Tags' => 'Tag'