wwwision / neos-creationdialogproperties
这是一个简单的包,它可以将节点属性轻松暴露给从Neos 3.3版本开始可用的CreationDialog。
0.6.2
2020-01-13 16:25 UTC
Requires
- neos/neos: ^3.3.2 || ^4.0 || ^5.0
This package is auto-updated.
Last update: 2024-08-29 04:20:08 UTC
README
这是一个简单的包,它可以将节点属性轻松暴露给从Neos 3.3版本开始可用的CreationDialog。
免责声明/背景
Neos 3.3版本附带了一个名为CreationDialog的全新功能,允许节点类型定义在创建相应节点时显示对话框。
默认情况下,需要实现自定义的nodeCreationHandler来处理CreationDialog的数据。此包提供了一个通用处理程序,允许轻松地将某些节点属性暴露以在对话框中显示。
在Neos 5.1版本中,此包的功能已引入到核心(请参阅文档)。因此,没有此包的Neos 5.1及以上版本兼容版本。
使用方法
- 通过
composer require wwwision/neos-creationdialogproperties
安装包 - 扩展节点类型定义,添加
showInCreationDialog
选项
示例节点类型配置
'Some.Package:Some.NodeType': superTypes: 'Neos.Neos:Content': true ui: label: 'Some Content Element' # ... properties: 'property1': type: string options: showInCreationDialog: true validation: 'Neos.Neos/Validation/NotEmptyValidator': [] ui: label: 'Mandatory link property' inspector: editor: 'Neos.Neos/Inspector/Editors/LinkEditor' 'property2': type: string options: showInCreationDialog: true ui: label: 'Optional selector property' inspector: editor: 'Neos.Neos/Inspector/Editors/SelectBoxEditor' editorOptions: values: 'value1': label: 'Label 01' 'value2': label: 'Label 02'
上述配置将导致以下Creation Dialog在插入相应类型的节点时显示