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.
SilverStripe 4.0+
Example:
DropdownImageField::create('LanguageID', 'Select language',
LanguageObj::get(), // Source for items.
'ID', // Key field on item.
'Title', // Caption field on item.
'Icon' // Image field on item. Can be a method/relation that returns an image.
)
This plugin uses a setTimeout
function with additional parameters. A polyfill is loaded to support IE9 and lower.