fullscreeninteractive / silverstripe-dropdownimagefield
Dropdown field with image support for SilverStripe CMS
Installs: 1 995
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 7
Language:JavaScript
Type:silverstripe-vendormodule
pkg:composer/fullscreeninteractive/silverstripe-dropdownimagefield
Requires
This package is auto-updated.
Last update: 2025-12-07 21:30:57 UTC
README
Adds a DropdownImageField field which enables you to display images alongside the captions.
Uses a plugin for Chosen.js (which is used by SS), Image-Select. The plugin is modified.
Requirements
SilverStripe 6
Install
composer require fullscreeninteractive/silverstripe-dropdownimagefield
Usage
Example:
DropdownImageField::create('Icon', 'Select icon') ->setSourceList($this->getAvailableIcons()) ... /** * Get the available icons for the dropdown * * @return ArrayList<ArrayData> */ public function getAvailableIcons(): ArrayList { $list = ArrayList::create(); $icons = [ 'car' => '/_resources/app/images/car.svg' ]; foreach ($icons as $key => $value) { $list->push(ArrayData::create([ 'ID' => $key, 'Title' => $key, 'Image' => $value ])); } return $list; }
