i13e / buttoneditor
Neos CMS的按钮编辑器插件
1.0.6
2023-05-02 05:55 UTC
Requires
- neos/neos-ui: ^5.3 || ^7.0 || ^8.0 || ^9.0
README
Neos CMS的按钮编辑器
本包提供了一个新的检查器编辑器,将其选项显示为按钮。
按钮操作类似于复选框或单选框。
安装
运行 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。
示例
上面的基本示例
多个允许空值
editorOptions: allowEmpty: true multiple: true values: # define your own
多个允许空值
editorOptions: allowEmpty: true values: toggle: label: i18n icon: toggle-off iconActive: toggle-on
已知问题
- 尽管ButtonEditor与Neos 5.3兼容,但它不支持自动标签i18n处理。在Neos 5.3中,请使用完整的翻译路径。
贡献
如果您想贡献,只需创建一个pull-request。
自豪地开发于汉诺威地区