PHPackages                             fromholdio/silverstripe-dependentgroupeddropdownfield - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fromholdio/silverstripe-dependentgroupeddropdownfield

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

fromholdio/silverstripe-dependentgroupeddropdownfield
=====================================================

A silverstripe groupeddropdown field that has it's options populated via ajax, based on the value of the field it depends on

4.1.1(7mo ago)12.3k[1 issues](https://github.com/fromholdio/silverstripe-dependentgroupeddropdownfield/issues)2BSD-3-ClauseJavaScript

Since Feb 17Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/fromholdio/silverstripe-dependentgroupeddropdownfield)[ Packagist](https://packagist.org/packages/fromholdio/silverstripe-dependentgroupeddropdownfield)[ Docs](https://github.com/fromholdio/silverstripe-dependentgroupeddropdownfield)[ RSS](/packages/fromholdio-silverstripe-dependentgroupeddropdownfield/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (8)Dependencies (1)Versions (15)Used By (2)

silverstripe-dependentgroupeddropdownfield
==========================================

[](#silverstripe-dependentgroupeddropdownfield)

A SilverStripe grouped dropdown field that has its options populated via ajax, based on the value of the dropdown field it depends on.

Note - this has been changed from v4+ from a fork of Shea Dawson's [silverstripe-dependentdropdownfield](https://github.com/sheadawson/silverstripe-dependentdropdownfield) to an extension of it instead. That is, the DependentGroupedDropdownField in this module is a subclass of the source DependentDropdownField.

Requirements
------------

[](#requirements)

SilverStripe 6.x

Installation
------------

[](#installation)

`composer require fromholdio/silverstripe-dependentgroupeddropdownfield`

What exactly is this?
---------------------

[](#what-exactly-is-this)

[![First load](docs/en/_images/01-load.png)](docs/en/_images/01-load.png)

See [user guide](docs/en/userguide.md) for usage screenshots.

Usage example
-------------

[](#usage-example)

First, create the `DropdownField` that your new field's values will be dependent on.

```
$typeField = DropdownField::create(
    'ProductType',
    'Product Type',
    [
        'animal' => 'Animal',
        'food' => 'Food'
    ]
);

$typeField->setEmptyString('Please select a product type');
```

Note: it is not necessary for the original dropdown field to have an empty string. If it doesn't, its first value will be used to auto-load the optgroups/options into your dependent field.

Second, create a callable function that returns an array suitable for the $source parameter of GroupedDropdownField. (A two dimensional array; the first level is used for the optgroup, and the second level for the of each group.)

```
$productFieldSource = function($value) {
    if ($value === 'animal') {
        return [
            'Fun' => [
                'puppy' => 'Puppy',
                'dog' => 'Dog'
            ],
            'Evil' => [
                'cat' => 'Cat'
            ]
        ];
    }
    if ($value === 'food') {
        return [
            'Fruit' => [
                'apple' => 'Apple',
                'orange' => 'Orange'
            ],
            'Vegetables' => [
                'carrot' => 'Carrot',
                'celery' => 'Celery'
            ]
        ];
    }
    return [];
};
```

Now, create your `DependentGroupedDropdownField`, setting the source as the callable function created above.

```
$productField = DependentGroupedDropdownField::create(
    'Product',
    'Product',
    $productFieldSource
);
```

Ensure that you connect the fields:

```
$productField->setDepends($typeField);
```

And now you're ready to go.

```
$fields->addFieldsToTab(
    'Root.Testing',
    [
        $typeField,
        $productField
    ]
);
```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance44

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~189 days

Recently: every ~15 days

Total

14

Last Release

220d ago

Major Versions

1.x-dev → 2.0.02023-05-23

2.x-dev → 3.x-dev2023-08-10

3.0.0 → 4.0.02025-09-18

PHP version history (2 changes)1.0.0PHP &gt;=5.6

2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/40e135ad117686bee39707c1d9286cc5e915e219c26a10d13858ca44d14f1eb0?d=identicon)[dizzystuff](/maintainers/dizzystuff)

---

Top Contributors

[![dizzystuff](https://avatars.githubusercontent.com/u/576903?v=4)](https://github.com/dizzystuff "dizzystuff (16 commits)")

---

Tags

silverstripedropdowngroupeddropdown

### Embed Badge

![Health badge](/badges/fromholdio-silverstripe-dependentgroupeddropdownfield/health.svg)

```
[![Health](https://phpackages.com/badges/fromholdio-silverstripe-dependentgroupeddropdownfield/health.svg)](https://phpackages.com/packages/fromholdio-silverstripe-dependentgroupeddropdownfield)
```

###  Alternatives

[sheadawson/silverstripe-dependentdropdownfield

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

28238.5k20](/packages/sheadawson-silverstripe-dependentdropdownfield)[dnadesign/silverstripe-advanceddropdowns

DropdownField and GroupedDropdownField that allows the use of data-attributes on each option tag

1717.4k](/packages/dnadesign-silverstripe-advanceddropdowns)[dnadesign/silverstripe-datedropdownselectorfield

Select your date values with Dropdown Fields

128.8k](/packages/dnadesign-silverstripe-datedropdownselectorfield)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
