i13e / buttoneditor

Neos CMS的按钮编辑器插件

安装次数: 398

依赖项: 0

建议者: 0

安全性: 0

星标: 9

关注者: 1

分支: 0

公开问题: 0

语言:JavaScript

类型:neos-package

1.0.6 2023-05-02 05:55 UTC

This package is auto-updated.

Last update: 2024-10-01 00:14:47 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Neos CMS的按钮编辑器

本包提供了一个新的检查器编辑器,将其选项显示为按钮。

按钮操作类似于复选框或单选框。

Align

安装

运行 composer require i13e/buttoneditor

使用方法

在你的属性中使用新的编辑器

I13e.Package:Content.Text:
  properties:
    align:
      # ButtonEditor supports "string" and "array"
      type: string
      defaultValue: left
      ui:
        label: 'Align'
        inspector:
          editor: I13e.ButtonEditor/ButtonEditor
          editorOptions:
            # Allow all buttons to be deselected
            # boolean, default: false
            allowEmpty: false
            # Allow multiple buttons to be active
            # If set to true also use `type` array
            # boolean, default: false
            multiple: false
            # Disable all buttons
            # boolean, default: false
            disabled: false
            values:
              left:
                label: i18n
                icon: align-left
              center:
                label: i18n
                icon: align-center
              right:
                label: i18n
                icon: align-right
              justify:
                label: i18n
                icon: align-justify
                # An alternative icon for the active state
                iconActive: align-justify
                # Disable a single option
                disabled: true
            
            # ---
            # Optionally use a data source:
            # 
            # If `dataSourceIdentifier` or `dataSourceUri` is defined, the `values` from above will be ignored
            dataSourceIdentifier: 'i13e-some-datasource'
            dataSourceUri: 'some/custom-route'
            dataSourceAdditionalData:
              group: 'align'
            dataSourceDisableCaching: false

如您所意识到的那样,配置几乎完全兼容默认的SelectBoxEditor

示例

上面的基本示例

Align

多个允许空值

editorOptions:
  allowEmpty: true
  multiple: true
  values:
    # define your own

Format

多个允许空值

editorOptions:
  allowEmpty: true
  values:
    toggle:
      label: i18n
      icon: toggle-off
      iconActive: toggle-on

Toggle

已知问题

  • 尽管ButtonEditor与Neos 5.3兼容,但它不支持自动标签i18n处理。在Neos 5.3中,请使用完整的翻译路径。

贡献

如果您想贡献,只需创建一个pull-request。

自豪地开发于汉诺威地区