fullscreeninteractive/silverstripe-dropdownimagefield 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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.

Working screenshot

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 7
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-15