定制 sunnysideup/silverstripe-verbosefields 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

sunnysideup/silverstripe-verbosefields

最新稳定版本:1.0.1

Composer 安装命令:

composer require sunnysideup/silverstripe-verbosefields

包简介

Silverstripe admin fields that let you provide more description content

README 文档

README

This is an addon for Silverstripe CMS that provides some custom field types providing more room to describe the options. It is designed only for use with the admin UI.

Right now, only VerboseOptionsetField is implemented, but I'd welcome contributions of a VerboseCheckboxSetField.

Animated screenshot of the field

Status

Experimental. This module has been freshly rolled out of some project code, and is yet to get its 2nd implementation. If you successfully use this on a project, please let me know!

Usage

First, install the module.

> composer require sminnee/silverstripe-verbosefields

The field is used much like an OptionsetField. setSourceDescriptions() lets you specify a map of HTML descriptions for each item.

use Sminnee\VerboseFields\VerboseOptionsetField;

// ...

function getCMSFields() {
    $fields = parent::getCMSFields();

    $descriptions = [
        'Apple' => '<b>Apple</b><p>A delicious fruit and also a hardware manufacturerer.<p><p><img src="..."></p>',
        'Orange' => '<b>Orange</b><p>A fruit that is usually turned into juice, rendering something somewhat healthy into a healthy-seeming confection.</p>',
        'Pear' => '<b>Pear</b><p>A ripe pear is an excellent choice for when your hands are too clean and need to be stickier.</p>',
    ];

    $source = [
        'Apple' => 'Apple',
        'Orange' => 'Orange',
        'Pear' => 'Pear',
    ];

    $fields->addFieldToTab(
        'Root.Tab',
        (new VerboseOptionsetField('Fruit', 'Fruit'))
            ->setSource($source)
            ->setSourceDescriptions($descriptions);
}

Contribution

Pull requests are loved! Issues are tolerated.

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2023-07-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固