PHPackages                             sheadawson/silverstripe-select2 - 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. sheadawson/silverstripe-select2

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

sheadawson/silverstripe-select2
===============================

A set of silverstripe form fields based on http://ivaynberg.github.com/select2/

1.0.1(10y ago)1923.6k20[4 issues](https://github.com/sheadawson/silverstripe-select2/issues)[2 PRs](https://github.com/sheadawson/silverstripe-select2/pulls)3PHP

Since Nov 28Pushed 7y ago6 watchersCompare

[ Source](https://github.com/sheadawson/silverstripe-select2)[ Packagist](https://packagist.org/packages/sheadawson/silverstripe-select2)[ Docs](http://github.com/sheadawson/silverstripe-select2)[ RSS](/packages/sheadawson-silverstripe-select2/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (5)Used By (3)

silverstripe-select2
====================

[](#silverstripe-select2)

Four silverstripe form fields based on .

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

[](#requirements)

SilverStripe framework ^4

Maintainer Contact
------------------

[](#maintainer-contact)

- Shea Dawson ()

Select2Field
------------

[](#select2field)

A basic dropdown field with enhanced Select2 UI

MultiSelect2Field
-----------------

[](#multiselect2field)

A multiple select dropdown field with Select2 UI

GroupedDropdownField
--------------------

[](#groupeddropdownfield)

Extends SilverStripes GroupedDropdownField to add the Select2 UI

AjaxSelect2Field
----------------

[](#ajaxselect2field)

The AjaxSelect2Field is a dropdown field that makes use of the ajax result loading and infinite scroll features of select2. This is really useful when you need to offer users a way of choosing an object from a list of hundreds or thousands of records that would either break or make standard dropdown/select fields slow and heavy to load. Note that this does not currently work with multiple selection. PR welcome ;)

### Usage

[](#usage)

A basic implementation will use configuration defaults to provide a dropdown list of SiteTree objects, suitable for searching for and selecting a page.

```
$field = AjaxSelect2Field::create('PageID');
```

### Configuration

[](#configuration)

You can configure your instance of AjaxSelect2Field with the following api. The setConfig() method is chainable, too.

#### Examples

[](#examples)

```
// Set a class to search for. Defaults to SiteTree
$field->setConfig('classToSearch', 'MyCustomObject');

// Set a list of fields to search on. Default is Title
$field->setConfig('searchFields', array('Title', 'ID'));

// Limit the number of results loaded per page (scroll set). Default is 200
$field->setConfig('resultsLimit', 100);

// The number of characters typed before search results are displayed. Default is 2.
$field->setConfig('minimumInputLength', 3);

// Configure how items should be displayed in the results list. The value gets parsed by the template parser
// You can use HTML too. Default is '$Title'.
$field->setConfig('resultsFormat', '$Title$AbsuluteLink');

// Configure how the currently selected item should be displayed. Default is '$Title'.
$field->setConfig('selectionFormat', '$Title ($ClassName)');

// Configure the text displayed when no item is selected. Default is 'Search...'
$field->setConfig('placeholder', 'Search for a Page...');

// Allow selection of multiple results. NOTE - you must handle the selected IDs (comma separated list) in code
$field->setConfig('multiple', true);
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% 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 ~391 days

Total

4

Last Release

3061d ago

Major Versions

1.0.0 → 2.0.x-dev2015-07-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ca23b453a4fc5ac237ad4fcc512f68fab5c7b124f403cad1a5848b3fffb6aa2?d=identicon)[sheadawson](/maintainers/sheadawson)

---

Top Contributors

[![sheadawson](https://avatars.githubusercontent.com/u/1166136?v=4)](https://github.com/sheadawson "sheadawson (21 commits)")[![joniahola](https://avatars.githubusercontent.com/u/1186126?v=4)](https://github.com/joniahola "joniahola (2 commits)")[![jules0x](https://avatars.githubusercontent.com/u/8979741?v=4)](https://github.com/jules0x "jules0x (2 commits)")[![anytech](https://avatars.githubusercontent.com/u/6244070?v=4)](https://github.com/anytech "anytech (1 commits)")[![zannstpierre](https://avatars.githubusercontent.com/u/546295?v=4)](https://github.com/zannstpierre "zannstpierre (1 commits)")

---

Tags

silverstripeajaxForms

### Embed Badge

![Health badge](/badges/sheadawson-silverstripe-select2/health.svg)

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

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1371.1M85](/packages/silverstripe-userforms)[unclecheese/display-logic

Allows assignment of conditions for display and hide of specific form fields based on client side behavior.

771.1M114](/packages/unclecheese-display-logic)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46302.4k9](/packages/symbiote-silverstripe-advancedworkflow)[silverstripe/multiform

SilverStripe forms with multiple steps, flow control and state persistence

3157.3k3](/packages/silverstripe-multiform)[mediawiki/page-forms

Forms for creating and editing wiki pages.

2380.7k2](/packages/mediawiki-page-forms)

PHPackages © 2026

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