fullscreeninteractive/silverstripe-dropdownimagefield
最新稳定版本:2.0.0
Composer 安装命令:
composer require fullscreeninteractive/silverstripe-dropdownimagefield
包简介
Dropdown field with image support for SilverStripe CMS
README 文档
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; }
统计信息
- 总下载量: 2k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-15
